squad-kit 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +6 -4
  2. package/SECURITY.md +7 -0
  3. package/dist/cli.js +1094 -46398
  4. package/dist/console-ui/assets/index-DqDPMvqu.css +1 -0
  5. package/dist/console-ui/assets/index-iFT5f2Y0.js +669 -0
  6. package/dist/console-ui/index.html +2 -2
  7. package/package.json +1 -2
  8. package/CHANGELOG.md +0 -1204
  9. package/dist/console-ui/assets/index-CzFTrbcF.js +0 -637
  10. package/dist/console-ui/assets/index-kEkCko25.css +0 -1
  11. package/dist/console-ui/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  12. package/dist/console-ui/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
  13. package/dist/console-ui/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
  14. package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-400-normal-C_uLvvQ5.woff2 +0 -0
  15. package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-500-normal-C9ShMxGR.woff2 +0 -0
  16. package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-600-normal-Dj6eZy5f.woff2 +0 -0
  17. package/dist/console-ui/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  18. package/dist/console-ui/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
  19. package/dist/console-ui/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
  20. package/dist/console-ui/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  21. package/dist/console-ui/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  22. package/dist/console-ui/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  23. package/dist/console-ui/assets/jetbrains-mono-vietnamese-400-normal-ByoDsISC.woff2 +0 -0
  24. package/dist/console-ui/assets/jetbrains-mono-vietnamese-500-normal-BvH7FW2L.woff2 +0 -0
  25. package/dist/console-ui/assets/jetbrains-mono-vietnamese-600-normal-Dtizs43-.woff2 +0 -0
@@ -0,0 +1,669 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();function qf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mh={exports:{}},Ka={},qh={exports:{}},_e={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var cx;function s5(){if(cx)return _e;cx=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=m&&B[m]||B["@@iterator"],typeof B=="function"?B:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function b(B,J,z){this.props=B,this.context=J,this.refs=k,this.updater=z||y}b.prototype.isReactComponent={},b.prototype.setState=function(B,J){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,J,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function S(){}S.prototype=b.prototype;function N(B,J,z){this.props=B,this.context=J,this.refs=k,this.updater=z||y}var $=N.prototype=new S;$.constructor=N,j($,b.prototype),$.isPureReactComponent=!0;var A=Array.isArray,R=Object.prototype.hasOwnProperty,E={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function F(B,J,z){var ye,fe={},ve=null,Fe=null;if(J!=null)for(ye in J.ref!==void 0&&(Fe=J.ref),J.key!==void 0&&(ve=""+J.key),J)R.call(J,ye)&&!M.hasOwnProperty(ye)&&(fe[ye]=J[ye]);var Ie=arguments.length-2;if(Ie===1)fe.children=z;else if(1<Ie){for(var Re=Array(Ie),Je=0;Je<Ie;Je++)Re[Je]=arguments[Je+2];fe.children=Re}if(B&&B.defaultProps)for(ye in Ie=B.defaultProps,Ie)fe[ye]===void 0&&(fe[ye]=Ie[ye]);return{$$typeof:e,type:B,key:ve,ref:Fe,props:fe,_owner:E.current}}function W(B,J){return{$$typeof:e,type:B.type,key:J,ref:B.ref,props:B.props,_owner:B._owner}}function I(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function q(B){var J={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(z){return J[z]})}var L=/\/+/g;function U(B,J){return typeof B=="object"&&B!==null&&B.key!=null?q(""+B.key):J.toString(36)}function _(B,J,z,ye,fe){var ve=typeof B;(ve==="undefined"||ve==="boolean")&&(B=null);var Fe=!1;if(B===null)Fe=!0;else switch(ve){case"string":case"number":Fe=!0;break;case"object":switch(B.$$typeof){case e:case n:Fe=!0}}if(Fe)return Fe=B,fe=fe(Fe),B=ye===""?"."+U(Fe,0):ye,A(fe)?(z="",B!=null&&(z=B.replace(L,"$&/")+"/"),_(fe,J,z,"",function(Je){return Je})):fe!=null&&(I(fe)&&(fe=W(fe,z+(!fe.key||Fe&&Fe.key===fe.key?"":(""+fe.key).replace(L,"$&/")+"/")+B)),J.push(fe)),1;if(Fe=0,ye=ye===""?".":ye+":",A(B))for(var Ie=0;Ie<B.length;Ie++){ve=B[Ie];var Re=ye+U(ve,Ie);Fe+=_(ve,J,z,Re,fe)}else if(Re=x(B),typeof Re=="function")for(B=Re.call(B),Ie=0;!(ve=B.next()).done;)ve=ve.value,Re=ye+U(ve,Ie++),Fe+=_(ve,J,z,Re,fe);else if(ve==="object")throw J=String(B),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.");return Fe}function G(B,J,z){if(B==null)return B;var ye=[],fe=0;return _(B,ye,"","",function(ve){return J.call(z,ve,fe++)}),ye}function le(B){if(B._status===-1){var J=B._result;J=J(),J.then(function(z){(B._status===0||B._status===-1)&&(B._status=1,B._result=z)},function(z){(B._status===0||B._status===-1)&&(B._status=2,B._result=z)}),B._status===-1&&(B._status=0,B._result=J)}if(B._status===1)return B._result.default;throw B._result}var V={current:null},Y={transition:null},te={ReactCurrentDispatcher:V,ReactCurrentBatchConfig:Y,ReactCurrentOwner:E};function P(){throw Error("act(...) is not supported in production builds of React.")}return _e.Children={map:G,forEach:function(B,J,z){G(B,function(){J.apply(this,arguments)},z)},count:function(B){var J=0;return G(B,function(){J++}),J},toArray:function(B){return G(B,function(J){return J})||[]},only:function(B){if(!I(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},_e.Component=b,_e.Fragment=s,_e.Profiler=i,_e.PureComponent=N,_e.StrictMode=r,_e.Suspense=d,_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,_e.act=P,_e.cloneElement=function(B,J,z){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var ye=j({},B.props),fe=B.key,ve=B.ref,Fe=B._owner;if(J!=null){if(J.ref!==void 0&&(ve=J.ref,Fe=E.current),J.key!==void 0&&(fe=""+J.key),B.type&&B.type.defaultProps)var Ie=B.type.defaultProps;for(Re in J)R.call(J,Re)&&!M.hasOwnProperty(Re)&&(ye[Re]=J[Re]===void 0&&Ie!==void 0?Ie[Re]:J[Re])}var Re=arguments.length-2;if(Re===1)ye.children=z;else if(1<Re){Ie=Array(Re);for(var Je=0;Je<Re;Je++)Ie[Je]=arguments[Je+2];ye.children=Ie}return{$$typeof:e,type:B.type,key:fe,ref:ve,props:ye,_owner:Fe}},_e.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:o,_context:B},B.Consumer=B},_e.createElement=F,_e.createFactory=function(B){var J=F.bind(null,B);return J.type=B,J},_e.createRef=function(){return{current:null}},_e.forwardRef=function(B){return{$$typeof:u,render:B}},_e.isValidElement=I,_e.lazy=function(B){return{$$typeof:f,_payload:{_status:-1,_result:B},_init:le}},_e.memo=function(B,J){return{$$typeof:p,type:B,compare:J===void 0?null:J}},_e.startTransition=function(B){var J=Y.transition;Y.transition={};try{B()}finally{Y.transition=J}},_e.unstable_act=P,_e.useCallback=function(B,J){return V.current.useCallback(B,J)},_e.useContext=function(B){return V.current.useContext(B)},_e.useDebugValue=function(){},_e.useDeferredValue=function(B){return V.current.useDeferredValue(B)},_e.useEffect=function(B,J){return V.current.useEffect(B,J)},_e.useId=function(){return V.current.useId()},_e.useImperativeHandle=function(B,J,z){return V.current.useImperativeHandle(B,J,z)},_e.useInsertionEffect=function(B,J){return V.current.useInsertionEffect(B,J)},_e.useLayoutEffect=function(B,J){return V.current.useLayoutEffect(B,J)},_e.useMemo=function(B,J){return V.current.useMemo(B,J)},_e.useReducer=function(B,J,z){return V.current.useReducer(B,J,z)},_e.useRef=function(B){return V.current.useRef(B)},_e.useState=function(B){return V.current.useState(B)},_e.useSyncExternalStore=function(B,J,z){return V.current.useSyncExternalStore(B,J,z)},_e.useTransition=function(){return V.current.useTransition()},_e.version="18.3.1",_e}var ux;function Bo(){return ux||(ux=1,qh.exports=s5()),qh.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var dx;function r5(){if(dx)return Ka;dx=1;var e=Bo(),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var f,m={},x=null,y=null;p!==void 0&&(x=""+p),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(y=d.ref);for(f in d)r.call(d,f)&&!o.hasOwnProperty(f)&&(m[f]=d[f]);if(u&&u.defaultProps)for(f in d=u.defaultProps,d)m[f]===void 0&&(m[f]=d[f]);return{$$typeof:n,type:u,key:x,ref:y,props:m,_owner:i.current}}return Ka.Fragment=s,Ka.jsx=l,Ka.jsxs=l,Ka}var hx;function i5(){return hx||(hx=1,Mh.exports=r5()),Mh.exports}var t=i5(),C=Bo();const po=qf(C);var gc={},Oh={exports:{}},ln={},_h={exports:{}},Dh={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var px;function a5(){return px||(px=1,(function(e){function n(Y,te){var P=Y.length;Y.push(te);e:for(;0<P;){var B=P-1>>>1,J=Y[B];if(0<i(J,te))Y[B]=te,Y[P]=J,P=B;else break e}}function s(Y){return Y.length===0?null:Y[0]}function r(Y){if(Y.length===0)return null;var te=Y[0],P=Y.pop();if(P!==te){Y[0]=P;e:for(var B=0,J=Y.length,z=J>>>1;B<z;){var ye=2*(B+1)-1,fe=Y[ye],ve=ye+1,Fe=Y[ve];if(0>i(fe,P))ve<J&&0>i(Fe,fe)?(Y[B]=Fe,Y[ve]=P,B=ve):(Y[B]=fe,Y[ye]=P,B=ye);else if(ve<J&&0>i(Fe,P))Y[B]=Fe,Y[ve]=P,B=ve;else break e}}return te}function i(Y,te){var P=Y.sortIndex-te.sortIndex;return P!==0?P:Y.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],f=1,m=null,x=3,y=!1,j=!1,k=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(Y){for(var te=s(p);te!==null;){if(te.callback===null)r(p);else if(te.startTime<=Y)r(p),te.sortIndex=te.expirationTime,n(d,te);else break;te=s(p)}}function A(Y){if(k=!1,$(Y),!j)if(s(d)!==null)j=!0,le(R);else{var te=s(p);te!==null&&V(A,te.startTime-Y)}}function R(Y,te){j=!1,k&&(k=!1,S(F),F=-1),y=!0;var P=x;try{for($(te),m=s(d);m!==null&&(!(m.expirationTime>te)||Y&&!q());){var B=m.callback;if(typeof B=="function"){m.callback=null,x=m.priorityLevel;var J=B(m.expirationTime<=te);te=e.unstable_now(),typeof J=="function"?m.callback=J:m===s(d)&&r(d),$(te)}else r(d);m=s(d)}if(m!==null)var z=!0;else{var ye=s(p);ye!==null&&V(A,ye.startTime-te),z=!1}return z}finally{m=null,x=P,y=!1}}var E=!1,M=null,F=-1,W=5,I=-1;function q(){return!(e.unstable_now()-I<W)}function L(){if(M!==null){var Y=e.unstable_now();I=Y;var te=!0;try{te=M(!0,Y)}finally{te?U():(E=!1,M=null)}}else E=!1}var U;if(typeof N=="function")U=function(){N(L)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,G=_.port2;_.port1.onmessage=L,U=function(){G.postMessage(null)}}else U=function(){b(L,0)};function le(Y){M=Y,E||(E=!0,U())}function V(Y,te){F=b(function(){Y(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Y){Y.callback=null},e.unstable_continueExecution=function(){j||y||(j=!0,le(R))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return s(d)},e.unstable_next=function(Y){switch(x){case 1:case 2:case 3:var te=3;break;default:te=x}var P=x;x=te;try{return Y()}finally{x=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,te){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var P=x;x=Y;try{return te()}finally{x=P}},e.unstable_scheduleCallback=function(Y,te,P){var B=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?B+P:B):P=B,Y){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=P+J,Y={id:f++,callback:te,priorityLevel:Y,startTime:P,expirationTime:J,sortIndex:-1},P>B?(Y.sortIndex=P,n(p,Y),s(d)===null&&Y===s(p)&&(k?(S(F),F=-1):k=!0,V(A,P-B))):(Y.sortIndex=J,n(d,Y),j||y||(j=!0,le(R))),Y},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Y){var te=x;return function(){var P=x;x=te;try{return Y.apply(this,arguments)}finally{x=P}}}})(Dh)),Dh}var fx;function o5(){return fx||(fx=1,_h.exports=a5()),_h.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var mx;function l5(){if(mx)return ln;mx=1;var e=Bo(),n=o5();function s(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(a,c){l(a,c),l(a+"Capture",c)}function l(a,c){for(i[a]=c,a=0;a<c.length;a++)r.add(c[a])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},m={};function x(a){return d.call(m,a)?!0:d.call(f,a)?!1:p.test(a)?m[a]=!0:(f[a]=!0,!1)}function y(a,c,h,g){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function j(a,c,h,g){if(c===null||typeof c>"u"||y(a,c,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function k(a,c,h,g,v,w,T){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=v,this.mustUseProperty=h,this.propertyName=a,this.type=c,this.sanitizeURL=w,this.removeEmptyString=T}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){b[a]=new k(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];b[c]=new k(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){b[a]=new k(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){b[a]=new k(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){b[a]=new k(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){b[a]=new k(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){b[a]=new k(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){b[a]=new k(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){b[a]=new k(a,5,!1,a.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(S,N);b[c]=new k(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(S,N);b[c]=new k(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(S,N);b[c]=new k(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){b[a]=new k(a,1,!1,a.toLowerCase(),null,!1,!1)}),b.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){b[a]=new k(a,1,!1,a.toLowerCase(),null,!0,!0)});function $(a,c,h,g){var v=b.hasOwnProperty(c)?b[c]:null;(v!==null?v.type!==0:g||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(j(c,h,v,g)&&(h=null),g||v===null?x(c)&&(h===null?a.removeAttribute(c):a.setAttribute(c,""+h)):v.mustUseProperty?a[v.propertyName]=h===null?v.type===3?!1:"":h:(c=v.attributeName,g=v.attributeNamespace,h===null?a.removeAttribute(c):(v=v.type,h=v===3||v===4&&h===!0?"":""+h,g?a.setAttributeNS(g,c,h):a.setAttribute(c,h))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),E=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),q=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),Y=Symbol.iterator;function te(a){return a===null||typeof a!="object"?null:(a=Y&&a[Y]||a["@@iterator"],typeof a=="function"?a:null)}var P=Object.assign,B;function J(a){if(B===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);B=c&&c[1]||""}return`
34
+ `+B+a}var z=!1;function ye(a,c){if(!a||z)return"";z=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(X){var g=X}Reflect.construct(a,[],c)}else{try{c.call()}catch(X){g=X}a.call(c.prototype)}else{try{throw Error()}catch(X){g=X}a()}}catch(X){if(X&&g&&typeof X.stack=="string"){for(var v=X.stack.split(`
35
+ `),w=g.stack.split(`
36
+ `),T=v.length-1,O=w.length-1;1<=T&&0<=O&&v[T]!==w[O];)O--;for(;1<=T&&0<=O;T--,O--)if(v[T]!==w[O]){if(T!==1||O!==1)do if(T--,O--,0>O||v[T]!==w[O]){var H=`
37
+ `+v[T].replace(" at new "," at ");return a.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",a.displayName)),H}while(1<=T&&0<=O);break}}}finally{z=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?J(a):""}function fe(a){switch(a.tag){case 5:return J(a.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return a=ye(a.type,!1),a;case 11:return a=ye(a.type.render,!1),a;case 1:return a=ye(a.type,!0),a;default:return""}}function ve(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case M:return"Fragment";case E:return"Portal";case W:return"Profiler";case F:return"StrictMode";case U:return"Suspense";case _:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case q:return(a.displayName||"Context")+".Consumer";case I:return(a._context.displayName||"Context")+".Provider";case L:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case G:return c=a.displayName||null,c!==null?c:ve(a.type)||"Memo";case le:c=a._payload,a=a._init;try{return ve(a(c))}catch{}}return null}function Fe(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ve(c);case 8:return c===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Ie(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Re(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Je(a){var c=Re(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),g=""+a[c];if(!a.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,w=h.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return v.call(this)},set:function(T){g=""+T,w.call(this,T)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(T){g=""+T},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Ot(a){a._valueTracker||(a._valueTracker=Je(a))}function $n(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return a&&(g=Re(a)?a.checked?"true":"false":a.value),a=g,a!==h?(c.setValue(a),!0):!1}function gt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Zt(a,c){var h=c.checked;return P({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function Tn(a,c){var h=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;h=Ie(c.value!=null?c.value:h),a._wrapperState={initialChecked:g,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function En(a,c){c=c.checked,c!=null&&$(a,"checked",c,!1)}function Vn(a,c){En(a,c);var h=Ie(c.value),g=c.type;if(h!=null)g==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?mn(a,c.type,h):c.hasOwnProperty("defaultValue")&&mn(a,c.type,Ie(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function Pt(a,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,h||c===a.value||(a.value=c),a.defaultValue=c}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function mn(a,c,h){(c!=="number"||gt(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var Ct=Array.isArray;function An(a,c,h,g){if(a=a.options,c){c={};for(var v=0;v<h.length;v++)c["$"+h[v]]=!0;for(h=0;h<a.length;h++)v=c.hasOwnProperty("$"+a[h].value),a[h].selected!==v&&(a[h].selected=v),v&&g&&(a[h].defaultSelected=!0)}else{for(h=""+Ie(h),c=null,v=0;v<a.length;v++){if(a[v].value===h){a[v].selected=!0,g&&(a[v].defaultSelected=!0);return}c!==null||a[v].disabled||(c=a[v])}c!==null&&(c.selected=!0)}}function Pn(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(s(91));return P({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Hs(a,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(s(92));if(Ct(h)){if(1<h.length)throw Error(s(93));h=h[0]}c=h}c==null&&(c=""),h=c}a._wrapperState={initialValue:Ie(h)}}function ls(a,c){var h=Ie(c.value),g=Ie(c.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),c.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),g!=null&&(a.defaultValue=""+g)}function Ge(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function ee(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?ee(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Te,Oe=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,g,v){MSApp.execUnsafeLocalFunction(function(){return a(c,h,g,v)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Te=Te||document.createElement("div"),Te.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Te.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function We(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var kt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Rn=["Webkit","ms","Moz","O"];Object.keys(kt).forEach(function(a){Rn.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),kt[c]=kt[a]})});function tn(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||kt.hasOwnProperty(a)&&kt[a]?(""+c).trim():c+"px"}function se(a,c){a=a.style;for(var h in c)if(c.hasOwnProperty(h)){var g=h.indexOf("--")===0,v=tn(h,c[h],g);h==="float"&&(h="cssFloat"),g?a.setProperty(h,v):a[h]=v}}var Ze=P({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function st(a,c){if(c){if(Ze[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(s(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(s(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(s(61))}if(c.style!=null&&typeof c.style!="object")throw Error(s(62))}}function xt(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ct=null;function Xu(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ju=null,ci=null,ui=null;function C1(a){if(a=Ra(a)){if(typeof Ju!="function")throw Error(s(280));var c=a.stateNode;c&&(c=Pl(c),Ju(a.stateNode,a.type,c))}}function $1(a){ci?ui?ui.push(a):ui=[a]:ci=a}function T1(){if(ci){var a=ci,c=ui;if(ui=ci=null,C1(a),c)for(a=0;a<c.length;a++)C1(c[a])}}function E1(a,c){return a(c)}function A1(){}var ed=!1;function P1(a,c,h){if(ed)return a(c,h);ed=!0;try{return E1(a,c,h)}finally{ed=!1,(ci!==null||ui!==null)&&(A1(),T1())}}function da(a,c){var h=a.stateNode;if(h===null)return null;var g=Pl(h);if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(s(231,c,typeof h));return h}var td=!1;if(u)try{var ha={};Object.defineProperty(ha,"passive",{get:function(){td=!0}}),window.addEventListener("test",ha,ha),window.removeEventListener("test",ha,ha)}catch{td=!1}function c3(a,c,h,g,v,w,T,O,H){var X=Array.prototype.slice.call(arguments,3);try{c.apply(h,X)}catch(ae){this.onError(ae)}}var pa=!1,cl=null,ul=!1,nd=null,u3={onError:function(a){pa=!0,cl=a}};function d3(a,c,h,g,v,w,T,O,H){pa=!1,cl=null,c3.apply(u3,arguments)}function h3(a,c,h,g,v,w,T,O,H){if(d3.apply(this,arguments),pa){if(pa){var X=cl;pa=!1,cl=null}else throw Error(s(198));ul||(ul=!0,nd=X)}}function br(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function R1(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function I1(a){if(br(a)!==a)throw Error(s(188))}function p3(a){var c=a.alternate;if(!c){if(c=br(a),c===null)throw Error(s(188));return c!==a?null:a}for(var h=a,g=c;;){var v=h.return;if(v===null)break;var w=v.alternate;if(w===null){if(g=v.return,g!==null){h=g;continue}break}if(v.child===w.child){for(w=v.child;w;){if(w===h)return I1(v),a;if(w===g)return I1(v),c;w=w.sibling}throw Error(s(188))}if(h.return!==g.return)h=v,g=w;else{for(var T=!1,O=v.child;O;){if(O===h){T=!0,h=v,g=w;break}if(O===g){T=!0,g=v,h=w;break}O=O.sibling}if(!T){for(O=w.child;O;){if(O===h){T=!0,h=w,g=v;break}if(O===g){T=!0,g=w,h=v;break}O=O.sibling}if(!T)throw Error(s(189))}}if(h.alternate!==g)throw Error(s(190))}if(h.tag!==3)throw Error(s(188));return h.stateNode.current===h?a:c}function F1(a){return a=p3(a),a!==null?z1(a):null}function z1(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=z1(a);if(c!==null)return c;a=a.sibling}return null}var L1=n.unstable_scheduleCallback,M1=n.unstable_cancelCallback,f3=n.unstable_shouldYield,m3=n.unstable_requestPaint,yt=n.unstable_now,g3=n.unstable_getCurrentPriorityLevel,sd=n.unstable_ImmediatePriority,q1=n.unstable_UserBlockingPriority,dl=n.unstable_NormalPriority,x3=n.unstable_LowPriority,O1=n.unstable_IdlePriority,hl=null,cs=null;function y3(a){if(cs&&typeof cs.onCommitFiberRoot=="function")try{cs.onCommitFiberRoot(hl,a,void 0,(a.current.flags&128)===128)}catch{}}var Kn=Math.clz32?Math.clz32:v3,j3=Math.log,k3=Math.LN2;function v3(a){return a>>>=0,a===0?32:31-(j3(a)/k3|0)|0}var pl=64,fl=4194304;function fa(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function ml(a,c){var h=a.pendingLanes;if(h===0)return 0;var g=0,v=a.suspendedLanes,w=a.pingedLanes,T=h&268435455;if(T!==0){var O=T&~v;O!==0?g=fa(O):(w&=T,w!==0&&(g=fa(w)))}else T=h&~v,T!==0?g=fa(T):w!==0&&(g=fa(w));if(g===0)return 0;if(c!==0&&c!==g&&(c&v)===0&&(v=g&-g,w=c&-c,v>=w||v===16&&(w&4194240)!==0))return c;if((g&4)!==0&&(g|=h&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=g;0<c;)h=31-Kn(c),v=1<<h,g|=a[h],c&=~v;return g}function b3(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function w3(a,c){for(var h=a.suspendedLanes,g=a.pingedLanes,v=a.expirationTimes,w=a.pendingLanes;0<w;){var T=31-Kn(w),O=1<<T,H=v[T];H===-1?((O&h)===0||(O&g)!==0)&&(v[T]=b3(O,c)):H<=c&&(a.expiredLanes|=O),w&=~O}}function rd(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function _1(){var a=pl;return pl<<=1,(pl&4194240)===0&&(pl=64),a}function id(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function ma(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Kn(c),a[c]=h}function N3(a,c){var h=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<h;){var v=31-Kn(h),w=1<<v;c[v]=0,g[v]=-1,a[v]=-1,h&=~w}}function ad(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var g=31-Kn(h),v=1<<g;v&c|a[g]&c&&(a[g]|=c),h&=~v}}var Xe=0;function D1(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var B1,od,W1,U1,H1,ld=!1,gl=[],Vs=null,Ks=null,Ys=null,ga=new Map,xa=new Map,Gs=[],S3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function V1(a,c){switch(a){case"focusin":case"focusout":Vs=null;break;case"dragenter":case"dragleave":Ks=null;break;case"mouseover":case"mouseout":Ys=null;break;case"pointerover":case"pointerout":ga.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":xa.delete(c.pointerId)}}function ya(a,c,h,g,v,w){return a===null||a.nativeEvent!==w?(a={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:w,targetContainers:[v]},c!==null&&(c=Ra(c),c!==null&&od(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,v!==null&&c.indexOf(v)===-1&&c.push(v),a)}function C3(a,c,h,g,v){switch(c){case"focusin":return Vs=ya(Vs,a,c,h,g,v),!0;case"dragenter":return Ks=ya(Ks,a,c,h,g,v),!0;case"mouseover":return Ys=ya(Ys,a,c,h,g,v),!0;case"pointerover":var w=v.pointerId;return ga.set(w,ya(ga.get(w)||null,a,c,h,g,v)),!0;case"gotpointercapture":return w=v.pointerId,xa.set(w,ya(xa.get(w)||null,a,c,h,g,v)),!0}return!1}function K1(a){var c=wr(a.target);if(c!==null){var h=br(c);if(h!==null){if(c=h.tag,c===13){if(c=R1(h),c!==null){a.blockedOn=c,H1(a.priority,function(){W1(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function xl(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=ud(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);ct=g,h.target.dispatchEvent(g),ct=null}else return c=Ra(h),c!==null&&od(c),a.blockedOn=h,!1;c.shift()}return!0}function Y1(a,c,h){xl(a)&&h.delete(c)}function $3(){ld=!1,Vs!==null&&xl(Vs)&&(Vs=null),Ks!==null&&xl(Ks)&&(Ks=null),Ys!==null&&xl(Ys)&&(Ys=null),ga.forEach(Y1),xa.forEach(Y1)}function ja(a,c){a.blockedOn===c&&(a.blockedOn=null,ld||(ld=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$3)))}function ka(a){function c(v){return ja(v,a)}if(0<gl.length){ja(gl[0],a);for(var h=1;h<gl.length;h++){var g=gl[h];g.blockedOn===a&&(g.blockedOn=null)}}for(Vs!==null&&ja(Vs,a),Ks!==null&&ja(Ks,a),Ys!==null&&ja(Ys,a),ga.forEach(c),xa.forEach(c),h=0;h<Gs.length;h++)g=Gs[h],g.blockedOn===a&&(g.blockedOn=null);for(;0<Gs.length&&(h=Gs[0],h.blockedOn===null);)K1(h),h.blockedOn===null&&Gs.shift()}var di=A.ReactCurrentBatchConfig,yl=!0;function T3(a,c,h,g){var v=Xe,w=di.transition;di.transition=null;try{Xe=1,cd(a,c,h,g)}finally{Xe=v,di.transition=w}}function E3(a,c,h,g){var v=Xe,w=di.transition;di.transition=null;try{Xe=4,cd(a,c,h,g)}finally{Xe=v,di.transition=w}}function cd(a,c,h,g){if(yl){var v=ud(a,c,h,g);if(v===null)$d(a,c,g,jl,h),V1(a,g);else if(C3(v,a,c,h,g))g.stopPropagation();else if(V1(a,g),c&4&&-1<S3.indexOf(a)){for(;v!==null;){var w=Ra(v);if(w!==null&&B1(w),w=ud(a,c,h,g),w===null&&$d(a,c,g,jl,h),w===v)break;v=w}v!==null&&g.stopPropagation()}else $d(a,c,g,null,h)}}var jl=null;function ud(a,c,h,g){if(jl=null,a=Xu(g),a=wr(a),a!==null)if(c=br(a),c===null)a=null;else if(h=c.tag,h===13){if(a=R1(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return jl=a,null}function G1(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(g3()){case sd:return 1;case q1:return 4;case dl:case x3:return 16;case O1:return 536870912;default:return 16}default:return 16}}var Qs=null,dd=null,kl=null;function Q1(){if(kl)return kl;var a,c=dd,h=c.length,g,v="value"in Qs?Qs.value:Qs.textContent,w=v.length;for(a=0;a<h&&c[a]===v[a];a++);var T=h-a;for(g=1;g<=T&&c[h-g]===v[w-g];g++);return kl=v.slice(a,1<g?1-g:void 0)}function vl(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function bl(){return!0}function Z1(){return!1}function gn(a){function c(h,g,v,w,T){this._reactName=h,this._targetInst=v,this.type=g,this.nativeEvent=w,this.target=T,this.currentTarget=null;for(var O in a)a.hasOwnProperty(O)&&(h=a[O],this[O]=h?h(w):w[O]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?bl:Z1,this.isPropagationStopped=Z1,this}return P(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),c}var hi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hd=gn(hi),va=P({},hi,{view:0,detail:0}),A3=gn(va),pd,fd,ba,wl=P({},va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==ba&&(ba&&a.type==="mousemove"?(pd=a.screenX-ba.screenX,fd=a.screenY-ba.screenY):fd=pd=0,ba=a),pd)},movementY:function(a){return"movementY"in a?a.movementY:fd}}),X1=gn(wl),P3=P({},wl,{dataTransfer:0}),R3=gn(P3),I3=P({},va,{relatedTarget:0}),md=gn(I3),F3=P({},hi,{animationName:0,elapsedTime:0,pseudoElement:0}),z3=gn(F3),L3=P({},hi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),M3=gn(L3),q3=P({},hi,{data:0}),J1=gn(q3),O3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_3={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},D3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function B3(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=D3[a])?!!c[a]:!1}function gd(){return B3}var W3=P({},va,{key:function(a){if(a.key){var c=O3[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=vl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?_3[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gd,charCode:function(a){return a.type==="keypress"?vl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?vl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),U3=gn(W3),H3=P({},wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eg=gn(H3),V3=P({},va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gd}),K3=gn(V3),Y3=P({},hi,{propertyName:0,elapsedTime:0,pseudoElement:0}),G3=gn(Y3),Q3=P({},wl,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Z3=gn(Q3),X3=[9,13,27,32],xd=u&&"CompositionEvent"in window,wa=null;u&&"documentMode"in document&&(wa=document.documentMode);var J3=u&&"TextEvent"in window&&!wa,tg=u&&(!xd||wa&&8<wa&&11>=wa),ng=" ",sg=!1;function rg(a,c){switch(a){case"keyup":return X3.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ig(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var pi=!1;function e4(a,c){switch(a){case"compositionend":return ig(c);case"keypress":return c.which!==32?null:(sg=!0,ng);case"textInput":return a=c.data,a===ng&&sg?null:a;default:return null}}function t4(a,c){if(pi)return a==="compositionend"||!xd&&rg(a,c)?(a=Q1(),kl=dd=Qs=null,pi=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return tg&&c.locale!=="ko"?null:c.data;default:return null}}var n4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ag(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!n4[a.type]:c==="textarea"}function og(a,c,h,g){$1(g),c=Tl(c,"onChange"),0<c.length&&(h=new hd("onChange","change",null,h,g),a.push({event:h,listeners:c}))}var Na=null,Sa=null;function s4(a){Sg(a,0)}function Nl(a){var c=yi(a);if($n(c))return a}function r4(a,c){if(a==="change")return c}var lg=!1;if(u){var yd;if(u){var jd="oninput"in document;if(!jd){var cg=document.createElement("div");cg.setAttribute("oninput","return;"),jd=typeof cg.oninput=="function"}yd=jd}else yd=!1;lg=yd&&(!document.documentMode||9<document.documentMode)}function ug(){Na&&(Na.detachEvent("onpropertychange",dg),Sa=Na=null)}function dg(a){if(a.propertyName==="value"&&Nl(Sa)){var c=[];og(c,Sa,a,Xu(a)),P1(s4,c)}}function i4(a,c,h){a==="focusin"?(ug(),Na=c,Sa=h,Na.attachEvent("onpropertychange",dg)):a==="focusout"&&ug()}function a4(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Nl(Sa)}function o4(a,c){if(a==="click")return Nl(c)}function l4(a,c){if(a==="input"||a==="change")return Nl(c)}function c4(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Yn=typeof Object.is=="function"?Object.is:c4;function Ca(a,c){if(Yn(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var v=h[g];if(!d.call(c,v)||!Yn(a[v],c[v]))return!1}return!0}function hg(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function pg(a,c){var h=hg(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=c&&g>=c)return{node:h,offset:c-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=hg(h)}}function fg(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?fg(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function mg(){for(var a=window,c=gt();c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=gt(a.document)}return c}function kd(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function u4(a){var c=mg(),h=a.focusedElem,g=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&fg(h.ownerDocument.documentElement,h)){if(g!==null&&kd(h)){if(c=g.start,a=g.end,a===void 0&&(a=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(a,h.value.length);else if(a=(c=h.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var v=h.textContent.length,w=Math.min(g.start,v);g=g.end===void 0?w:Math.min(g.end,v),!a.extend&&w>g&&(v=g,g=w,w=v),v=pg(h,w);var T=pg(h,g);v&&T&&(a.rangeCount!==1||a.anchorNode!==v.node||a.anchorOffset!==v.offset||a.focusNode!==T.node||a.focusOffset!==T.offset)&&(c=c.createRange(),c.setStart(v.node,v.offset),a.removeAllRanges(),w>g?(a.addRange(c),a.extend(T.node,T.offset)):(c.setEnd(T.node,T.offset),a.addRange(c)))}}for(c=[],a=h;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)a=c[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var d4=u&&"documentMode"in document&&11>=document.documentMode,fi=null,vd=null,$a=null,bd=!1;function gg(a,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;bd||fi==null||fi!==gt(g)||(g=fi,"selectionStart"in g&&kd(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),$a&&Ca($a,g)||($a=g,g=Tl(vd,"onSelect"),0<g.length&&(c=new hd("onSelect","select",null,c,h),a.push({event:c,listeners:g}),c.target=fi)))}function Sl(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var mi={animationend:Sl("Animation","AnimationEnd"),animationiteration:Sl("Animation","AnimationIteration"),animationstart:Sl("Animation","AnimationStart"),transitionend:Sl("Transition","TransitionEnd")},wd={},xg={};u&&(xg=document.createElement("div").style,"AnimationEvent"in window||(delete mi.animationend.animation,delete mi.animationiteration.animation,delete mi.animationstart.animation),"TransitionEvent"in window||delete mi.transitionend.transition);function Cl(a){if(wd[a])return wd[a];if(!mi[a])return a;var c=mi[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in xg)return wd[a]=c[h];return a}var yg=Cl("animationend"),jg=Cl("animationiteration"),kg=Cl("animationstart"),vg=Cl("transitionend"),bg=new Map,wg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Zs(a,c){bg.set(a,c),o(c,[a])}for(var Nd=0;Nd<wg.length;Nd++){var Sd=wg[Nd],h4=Sd.toLowerCase(),p4=Sd[0].toUpperCase()+Sd.slice(1);Zs(h4,"on"+p4)}Zs(yg,"onAnimationEnd"),Zs(jg,"onAnimationIteration"),Zs(kg,"onAnimationStart"),Zs("dblclick","onDoubleClick"),Zs("focusin","onFocus"),Zs("focusout","onBlur"),Zs(vg,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ta="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),f4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ta));function Ng(a,c,h){var g=a.type||"unknown-event";a.currentTarget=h,h3(g,c,void 0,a),a.currentTarget=null}function Sg(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],v=g.event;g=g.listeners;e:{var w=void 0;if(c)for(var T=g.length-1;0<=T;T--){var O=g[T],H=O.instance,X=O.currentTarget;if(O=O.listener,H!==w&&v.isPropagationStopped())break e;Ng(v,O,X),w=H}else for(T=0;T<g.length;T++){if(O=g[T],H=O.instance,X=O.currentTarget,O=O.listener,H!==w&&v.isPropagationStopped())break e;Ng(v,O,X),w=H}}}if(ul)throw a=nd,ul=!1,nd=null,a}function rt(a,c){var h=c[Id];h===void 0&&(h=c[Id]=new Set);var g=a+"__bubble";h.has(g)||(Cg(c,a,2,!1),h.add(g))}function Cd(a,c,h){var g=0;c&&(g|=4),Cg(h,a,g,c)}var $l="_reactListening"+Math.random().toString(36).slice(2);function Ea(a){if(!a[$l]){a[$l]=!0,r.forEach(function(h){h!=="selectionchange"&&(f4.has(h)||Cd(h,!1,a),Cd(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[$l]||(c[$l]=!0,Cd("selectionchange",!1,c))}}function Cg(a,c,h,g){switch(G1(c)){case 1:var v=T3;break;case 4:v=E3;break;default:v=cd}h=v.bind(null,c,h,a),v=void 0,!td||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(v=!0),g?v!==void 0?a.addEventListener(c,h,{capture:!0,passive:v}):a.addEventListener(c,h,!0):v!==void 0?a.addEventListener(c,h,{passive:v}):a.addEventListener(c,h,!1)}function $d(a,c,h,g,v){var w=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var T=g.tag;if(T===3||T===4){var O=g.stateNode.containerInfo;if(O===v||O.nodeType===8&&O.parentNode===v)break;if(T===4)for(T=g.return;T!==null;){var H=T.tag;if((H===3||H===4)&&(H=T.stateNode.containerInfo,H===v||H.nodeType===8&&H.parentNode===v))return;T=T.return}for(;O!==null;){if(T=wr(O),T===null)return;if(H=T.tag,H===5||H===6){g=w=T;continue e}O=O.parentNode}}g=g.return}P1(function(){var X=w,ae=Xu(h),ce=[];e:{var ie=bg.get(a);if(ie!==void 0){var me=hd,ke=a;switch(a){case"keypress":if(vl(h)===0)break e;case"keydown":case"keyup":me=U3;break;case"focusin":ke="focus",me=md;break;case"focusout":ke="blur",me=md;break;case"beforeblur":case"afterblur":me=md;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=X1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=R3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=K3;break;case yg:case jg:case kg:me=z3;break;case vg:me=G3;break;case"scroll":me=A3;break;case"wheel":me=Z3;break;case"copy":case"cut":case"paste":me=M3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=eg}var be=(c&4)!==0,jt=!be&&a==="scroll",Q=be?ie!==null?ie+"Capture":null:ie;be=[];for(var K=X,Z;K!==null;){Z=K;var he=Z.stateNode;if(Z.tag===5&&he!==null&&(Z=he,Q!==null&&(he=da(K,Q),he!=null&&be.push(Aa(K,he,Z)))),jt)break;K=K.return}0<be.length&&(ie=new me(ie,ke,null,h,ae),ce.push({event:ie,listeners:be}))}}if((c&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",me=a==="mouseout"||a==="pointerout",ie&&h!==ct&&(ke=h.relatedTarget||h.fromElement)&&(wr(ke)||ke[Ss]))break e;if((me||ie)&&(ie=ae.window===ae?ae:(ie=ae.ownerDocument)?ie.defaultView||ie.parentWindow:window,me?(ke=h.relatedTarget||h.toElement,me=X,ke=ke?wr(ke):null,ke!==null&&(jt=br(ke),ke!==jt||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(me=null,ke=X),me!==ke)){if(be=X1,he="onMouseLeave",Q="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&(be=eg,he="onPointerLeave",Q="onPointerEnter",K="pointer"),jt=me==null?ie:yi(me),Z=ke==null?ie:yi(ke),ie=new be(he,K+"leave",me,h,ae),ie.target=jt,ie.relatedTarget=Z,he=null,wr(ae)===X&&(be=new be(Q,K+"enter",ke,h,ae),be.target=Z,be.relatedTarget=jt,he=be),jt=he,me&&ke)t:{for(be=me,Q=ke,K=0,Z=be;Z;Z=gi(Z))K++;for(Z=0,he=Q;he;he=gi(he))Z++;for(;0<K-Z;)be=gi(be),K--;for(;0<Z-K;)Q=gi(Q),Z--;for(;K--;){if(be===Q||Q!==null&&be===Q.alternate)break t;be=gi(be),Q=gi(Q)}be=null}else be=null;me!==null&&$g(ce,ie,me,be,!1),ke!==null&&jt!==null&&$g(ce,jt,ke,be,!0)}}e:{if(ie=X?yi(X):window,me=ie.nodeName&&ie.nodeName.toLowerCase(),me==="select"||me==="input"&&ie.type==="file")var we=r4;else if(ag(ie))if(lg)we=l4;else{we=a4;var Ee=i4}else(me=ie.nodeName)&&me.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(we=o4);if(we&&(we=we(a,X))){og(ce,we,h,ae);break e}Ee&&Ee(a,ie,X),a==="focusout"&&(Ee=ie._wrapperState)&&Ee.controlled&&ie.type==="number"&&mn(ie,"number",ie.value)}switch(Ee=X?yi(X):window,a){case"focusin":(ag(Ee)||Ee.contentEditable==="true")&&(fi=Ee,vd=X,$a=null);break;case"focusout":$a=vd=fi=null;break;case"mousedown":bd=!0;break;case"contextmenu":case"mouseup":case"dragend":bd=!1,gg(ce,h,ae);break;case"selectionchange":if(d4)break;case"keydown":case"keyup":gg(ce,h,ae)}var Ae;if(xd)e:{switch(a){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else pi?rg(a,h)&&(ze="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(ze="onCompositionStart");ze&&(tg&&h.locale!=="ko"&&(pi||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&pi&&(Ae=Q1()):(Qs=ae,dd="value"in Qs?Qs.value:Qs.textContent,pi=!0)),Ee=Tl(X,ze),0<Ee.length&&(ze=new J1(ze,a,null,h,ae),ce.push({event:ze,listeners:Ee}),Ae?ze.data=Ae:(Ae=ig(h),Ae!==null&&(ze.data=Ae)))),(Ae=J3?e4(a,h):t4(a,h))&&(X=Tl(X,"onBeforeInput"),0<X.length&&(ae=new J1("onBeforeInput","beforeinput",null,h,ae),ce.push({event:ae,listeners:X}),ae.data=Ae))}Sg(ce,c)})}function Aa(a,c,h){return{instance:a,listener:c,currentTarget:h}}function Tl(a,c){for(var h=c+"Capture",g=[];a!==null;){var v=a,w=v.stateNode;v.tag===5&&w!==null&&(v=w,w=da(a,h),w!=null&&g.unshift(Aa(a,w,v)),w=da(a,c),w!=null&&g.push(Aa(a,w,v))),a=a.return}return g}function gi(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function $g(a,c,h,g,v){for(var w=c._reactName,T=[];h!==null&&h!==g;){var O=h,H=O.alternate,X=O.stateNode;if(H!==null&&H===g)break;O.tag===5&&X!==null&&(O=X,v?(H=da(h,w),H!=null&&T.unshift(Aa(h,H,O))):v||(H=da(h,w),H!=null&&T.push(Aa(h,H,O)))),h=h.return}T.length!==0&&a.push({event:c,listeners:T})}var m4=/\r\n?/g,g4=/\u0000|\uFFFD/g;function Tg(a){return(typeof a=="string"?a:""+a).replace(m4,`
38
+ `).replace(g4,"")}function El(a,c,h){if(c=Tg(c),Tg(a)!==c&&h)throw Error(s(425))}function Al(){}var Td=null,Ed=null;function Ad(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Pd=typeof setTimeout=="function"?setTimeout:void 0,x4=typeof clearTimeout=="function"?clearTimeout:void 0,Eg=typeof Promise=="function"?Promise:void 0,y4=typeof queueMicrotask=="function"?queueMicrotask:typeof Eg<"u"?function(a){return Eg.resolve(null).then(a).catch(j4)}:Pd;function j4(a){setTimeout(function(){throw a})}function Rd(a,c){var h=c,g=0;do{var v=h.nextSibling;if(a.removeChild(h),v&&v.nodeType===8)if(h=v.data,h==="/$"){if(g===0){a.removeChild(v),ka(c);return}g--}else h!=="$"&&h!=="$?"&&h!=="$!"||g++;h=v}while(h);ka(c)}function Xs(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function Ag(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return a;c--}else h==="/$"&&c++}a=a.previousSibling}return null}var xi=Math.random().toString(36).slice(2),us="__reactFiber$"+xi,Pa="__reactProps$"+xi,Ss="__reactContainer$"+xi,Id="__reactEvents$"+xi,k4="__reactListeners$"+xi,v4="__reactHandles$"+xi;function wr(a){var c=a[us];if(c)return c;for(var h=a.parentNode;h;){if(c=h[Ss]||h[us]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=Ag(a);a!==null;){if(h=a[us])return h;a=Ag(a)}return c}a=h,h=a.parentNode}return null}function Ra(a){return a=a[us]||a[Ss],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function yi(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(s(33))}function Pl(a){return a[Pa]||null}var Fd=[],ji=-1;function Js(a){return{current:a}}function it(a){0>ji||(a.current=Fd[ji],Fd[ji]=null,ji--)}function tt(a,c){ji++,Fd[ji]=a.current,a.current=c}var er={},_t=Js(er),nn=Js(!1),Nr=er;function ki(a,c){var h=a.type.contextTypes;if(!h)return er;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var v={},w;for(w in h)v[w]=c[w];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=v),v}function sn(a){return a=a.childContextTypes,a!=null}function Rl(){it(nn),it(_t)}function Pg(a,c,h){if(_t.current!==er)throw Error(s(168));tt(_t,c),tt(nn,h)}function Rg(a,c,h){var g=a.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var v in g)if(!(v in c))throw Error(s(108,Fe(a)||"Unknown",v));return P({},h,g)}function Il(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||er,Nr=_t.current,tt(_t,a),tt(nn,nn.current),!0}function Ig(a,c,h){var g=a.stateNode;if(!g)throw Error(s(169));h?(a=Rg(a,c,Nr),g.__reactInternalMemoizedMergedChildContext=a,it(nn),it(_t),tt(_t,a)):it(nn),tt(nn,h)}var Cs=null,Fl=!1,zd=!1;function Fg(a){Cs===null?Cs=[a]:Cs.push(a)}function b4(a){Fl=!0,Fg(a)}function tr(){if(!zd&&Cs!==null){zd=!0;var a=0,c=Xe;try{var h=Cs;for(Xe=1;a<h.length;a++){var g=h[a];do g=g(!0);while(g!==null)}Cs=null,Fl=!1}catch(v){throw Cs!==null&&(Cs=Cs.slice(a+1)),L1(sd,tr),v}finally{Xe=c,zd=!1}}return null}var vi=[],bi=0,zl=null,Ll=0,In=[],Fn=0,Sr=null,$s=1,Ts="";function Cr(a,c){vi[bi++]=Ll,vi[bi++]=zl,zl=a,Ll=c}function zg(a,c,h){In[Fn++]=$s,In[Fn++]=Ts,In[Fn++]=Sr,Sr=a;var g=$s;a=Ts;var v=32-Kn(g)-1;g&=~(1<<v),h+=1;var w=32-Kn(c)+v;if(30<w){var T=v-v%5;w=(g&(1<<T)-1).toString(32),g>>=T,v-=T,$s=1<<32-Kn(c)+v|h<<v|g,Ts=w+a}else $s=1<<w|h<<v|g,Ts=a}function Ld(a){a.return!==null&&(Cr(a,1),zg(a,1,0))}function Md(a){for(;a===zl;)zl=vi[--bi],vi[bi]=null,Ll=vi[--bi],vi[bi]=null;for(;a===Sr;)Sr=In[--Fn],In[Fn]=null,Ts=In[--Fn],In[Fn]=null,$s=In[--Fn],In[Fn]=null}var xn=null,yn=null,ot=!1,Gn=null;function Lg(a,c){var h=qn(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=a,c=a.deletions,c===null?(a.deletions=[h],a.flags|=16):c.push(h)}function Mg(a,c){switch(a.tag){case 5:var h=a.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,xn=a,yn=Xs(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,xn=a,yn=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=Sr!==null?{id:$s,overflow:Ts}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=qn(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,xn=a,yn=null,!0):!1;default:return!1}}function qd(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Od(a){if(ot){var c=yn;if(c){var h=c;if(!Mg(a,c)){if(qd(a))throw Error(s(418));c=Xs(h.nextSibling);var g=xn;c&&Mg(a,c)?Lg(g,h):(a.flags=a.flags&-4097|2,ot=!1,xn=a)}}else{if(qd(a))throw Error(s(418));a.flags=a.flags&-4097|2,ot=!1,xn=a}}}function qg(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;xn=a}function Ml(a){if(a!==xn)return!1;if(!ot)return qg(a),ot=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Ad(a.type,a.memoizedProps)),c&&(c=yn)){if(qd(a))throw Og(),Error(s(418));for(;c;)Lg(a,c),c=Xs(c.nextSibling)}if(qg(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(c===0){yn=Xs(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}yn=null}}else yn=xn?Xs(a.stateNode.nextSibling):null;return!0}function Og(){for(var a=yn;a;)a=Xs(a.nextSibling)}function wi(){yn=xn=null,ot=!1}function _d(a){Gn===null?Gn=[a]:Gn.push(a)}var w4=A.ReactCurrentBatchConfig;function Ia(a,c,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(s(309));var g=h.stateNode}if(!g)throw Error(s(147,a));var v=g,w=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===w?c.ref:(c=function(T){var O=v.refs;T===null?delete O[w]:O[w]=T},c._stringRef=w,c)}if(typeof a!="string")throw Error(s(284));if(!h._owner)throw Error(s(290,a))}return a}function ql(a,c){throw a=Object.prototype.toString.call(c),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function _g(a){var c=a._init;return c(a._payload)}function Dg(a){function c(Q,K){if(a){var Z=Q.deletions;Z===null?(Q.deletions=[K],Q.flags|=16):Z.push(K)}}function h(Q,K){if(!a)return null;for(;K!==null;)c(Q,K),K=K.sibling;return null}function g(Q,K){for(Q=new Map;K!==null;)K.key!==null?Q.set(K.key,K):Q.set(K.index,K),K=K.sibling;return Q}function v(Q,K){return Q=cr(Q,K),Q.index=0,Q.sibling=null,Q}function w(Q,K,Z){return Q.index=Z,a?(Z=Q.alternate,Z!==null?(Z=Z.index,Z<K?(Q.flags|=2,K):Z):(Q.flags|=2,K)):(Q.flags|=1048576,K)}function T(Q){return a&&Q.alternate===null&&(Q.flags|=2),Q}function O(Q,K,Z,he){return K===null||K.tag!==6?(K=Ph(Z,Q.mode,he),K.return=Q,K):(K=v(K,Z),K.return=Q,K)}function H(Q,K,Z,he){var we=Z.type;return we===M?ae(Q,K,Z.props.children,he,Z.key):K!==null&&(K.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===le&&_g(we)===K.type)?(he=v(K,Z.props),he.ref=Ia(Q,K,Z),he.return=Q,he):(he=lc(Z.type,Z.key,Z.props,null,Q.mode,he),he.ref=Ia(Q,K,Z),he.return=Q,he)}function X(Q,K,Z,he){return K===null||K.tag!==4||K.stateNode.containerInfo!==Z.containerInfo||K.stateNode.implementation!==Z.implementation?(K=Rh(Z,Q.mode,he),K.return=Q,K):(K=v(K,Z.children||[]),K.return=Q,K)}function ae(Q,K,Z,he,we){return K===null||K.tag!==7?(K=Fr(Z,Q.mode,he,we),K.return=Q,K):(K=v(K,Z),K.return=Q,K)}function ce(Q,K,Z){if(typeof K=="string"&&K!==""||typeof K=="number")return K=Ph(""+K,Q.mode,Z),K.return=Q,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case R:return Z=lc(K.type,K.key,K.props,null,Q.mode,Z),Z.ref=Ia(Q,null,K),Z.return=Q,Z;case E:return K=Rh(K,Q.mode,Z),K.return=Q,K;case le:var he=K._init;return ce(Q,he(K._payload),Z)}if(Ct(K)||te(K))return K=Fr(K,Q.mode,Z,null),K.return=Q,K;ql(Q,K)}return null}function ie(Q,K,Z,he){var we=K!==null?K.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return we!==null?null:O(Q,K,""+Z,he);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:return Z.key===we?H(Q,K,Z,he):null;case E:return Z.key===we?X(Q,K,Z,he):null;case le:return we=Z._init,ie(Q,K,we(Z._payload),he)}if(Ct(Z)||te(Z))return we!==null?null:ae(Q,K,Z,he,null);ql(Q,Z)}return null}function me(Q,K,Z,he,we){if(typeof he=="string"&&he!==""||typeof he=="number")return Q=Q.get(Z)||null,O(K,Q,""+he,we);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case R:return Q=Q.get(he.key===null?Z:he.key)||null,H(K,Q,he,we);case E:return Q=Q.get(he.key===null?Z:he.key)||null,X(K,Q,he,we);case le:var Ee=he._init;return me(Q,K,Z,Ee(he._payload),we)}if(Ct(he)||te(he))return Q=Q.get(Z)||null,ae(K,Q,he,we,null);ql(K,he)}return null}function ke(Q,K,Z,he){for(var we=null,Ee=null,Ae=K,ze=K=0,Ft=null;Ae!==null&&ze<Z.length;ze++){Ae.index>ze?(Ft=Ae,Ae=null):Ft=Ae.sibling;var Ye=ie(Q,Ae,Z[ze],he);if(Ye===null){Ae===null&&(Ae=Ft);break}a&&Ae&&Ye.alternate===null&&c(Q,Ae),K=w(Ye,K,ze),Ee===null?we=Ye:Ee.sibling=Ye,Ee=Ye,Ae=Ft}if(ze===Z.length)return h(Q,Ae),ot&&Cr(Q,ze),we;if(Ae===null){for(;ze<Z.length;ze++)Ae=ce(Q,Z[ze],he),Ae!==null&&(K=w(Ae,K,ze),Ee===null?we=Ae:Ee.sibling=Ae,Ee=Ae);return ot&&Cr(Q,ze),we}for(Ae=g(Q,Ae);ze<Z.length;ze++)Ft=me(Ae,Q,ze,Z[ze],he),Ft!==null&&(a&&Ft.alternate!==null&&Ae.delete(Ft.key===null?ze:Ft.key),K=w(Ft,K,ze),Ee===null?we=Ft:Ee.sibling=Ft,Ee=Ft);return a&&Ae.forEach(function(ur){return c(Q,ur)}),ot&&Cr(Q,ze),we}function be(Q,K,Z,he){var we=te(Z);if(typeof we!="function")throw Error(s(150));if(Z=we.call(Z),Z==null)throw Error(s(151));for(var Ee=we=null,Ae=K,ze=K=0,Ft=null,Ye=Z.next();Ae!==null&&!Ye.done;ze++,Ye=Z.next()){Ae.index>ze?(Ft=Ae,Ae=null):Ft=Ae.sibling;var ur=ie(Q,Ae,Ye.value,he);if(ur===null){Ae===null&&(Ae=Ft);break}a&&Ae&&ur.alternate===null&&c(Q,Ae),K=w(ur,K,ze),Ee===null?we=ur:Ee.sibling=ur,Ee=ur,Ae=Ft}if(Ye.done)return h(Q,Ae),ot&&Cr(Q,ze),we;if(Ae===null){for(;!Ye.done;ze++,Ye=Z.next())Ye=ce(Q,Ye.value,he),Ye!==null&&(K=w(Ye,K,ze),Ee===null?we=Ye:Ee.sibling=Ye,Ee=Ye);return ot&&Cr(Q,ze),we}for(Ae=g(Q,Ae);!Ye.done;ze++,Ye=Z.next())Ye=me(Ae,Q,ze,Ye.value,he),Ye!==null&&(a&&Ye.alternate!==null&&Ae.delete(Ye.key===null?ze:Ye.key),K=w(Ye,K,ze),Ee===null?we=Ye:Ee.sibling=Ye,Ee=Ye);return a&&Ae.forEach(function(n5){return c(Q,n5)}),ot&&Cr(Q,ze),we}function jt(Q,K,Z,he){if(typeof Z=="object"&&Z!==null&&Z.type===M&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:e:{for(var we=Z.key,Ee=K;Ee!==null;){if(Ee.key===we){if(we=Z.type,we===M){if(Ee.tag===7){h(Q,Ee.sibling),K=v(Ee,Z.props.children),K.return=Q,Q=K;break e}}else if(Ee.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===le&&_g(we)===Ee.type){h(Q,Ee.sibling),K=v(Ee,Z.props),K.ref=Ia(Q,Ee,Z),K.return=Q,Q=K;break e}h(Q,Ee);break}else c(Q,Ee);Ee=Ee.sibling}Z.type===M?(K=Fr(Z.props.children,Q.mode,he,Z.key),K.return=Q,Q=K):(he=lc(Z.type,Z.key,Z.props,null,Q.mode,he),he.ref=Ia(Q,K,Z),he.return=Q,Q=he)}return T(Q);case E:e:{for(Ee=Z.key;K!==null;){if(K.key===Ee)if(K.tag===4&&K.stateNode.containerInfo===Z.containerInfo&&K.stateNode.implementation===Z.implementation){h(Q,K.sibling),K=v(K,Z.children||[]),K.return=Q,Q=K;break e}else{h(Q,K);break}else c(Q,K);K=K.sibling}K=Rh(Z,Q.mode,he),K.return=Q,Q=K}return T(Q);case le:return Ee=Z._init,jt(Q,K,Ee(Z._payload),he)}if(Ct(Z))return ke(Q,K,Z,he);if(te(Z))return be(Q,K,Z,he);ql(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,K!==null&&K.tag===6?(h(Q,K.sibling),K=v(K,Z),K.return=Q,Q=K):(h(Q,K),K=Ph(Z,Q.mode,he),K.return=Q,Q=K),T(Q)):h(Q,K)}return jt}var Ni=Dg(!0),Bg=Dg(!1),Ol=Js(null),_l=null,Si=null,Dd=null;function Bd(){Dd=Si=_l=null}function Wd(a){var c=Ol.current;it(Ol),a._currentValue=c}function Ud(a,c,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===h)break;a=a.return}}function Ci(a,c){_l=a,Dd=Si=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(rn=!0),a.firstContext=null)}function zn(a){var c=a._currentValue;if(Dd!==a)if(a={context:a,memoizedValue:c,next:null},Si===null){if(_l===null)throw Error(s(308));Si=a,_l.dependencies={lanes:0,firstContext:a}}else Si=Si.next=a;return c}var $r=null;function Hd(a){$r===null?$r=[a]:$r.push(a)}function Wg(a,c,h,g){var v=c.interleaved;return v===null?(h.next=h,Hd(c)):(h.next=v.next,v.next=h),c.interleaved=h,Es(a,g)}function Es(a,c){a.lanes|=c;var h=a.alternate;for(h!==null&&(h.lanes|=c),h=a,a=a.return;a!==null;)a.childLanes|=c,h=a.alternate,h!==null&&(h.childLanes|=c),h=a,a=a.return;return h.tag===3?h.stateNode:null}var nr=!1;function Vd(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ug(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function As(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function sr(a,c,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Ve&2)!==0){var v=g.pending;return v===null?c.next=c:(c.next=v.next,v.next=c),g.pending=c,Es(a,h)}return v=g.interleaved,v===null?(c.next=c,Hd(g)):(c.next=v.next,v.next=c),g.interleaved=c,Es(a,h)}function Dl(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,ad(a,h)}}function Hg(a,c){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var v=null,w=null;if(h=h.firstBaseUpdate,h!==null){do{var T={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};w===null?v=w=T:w=w.next=T,h=h.next}while(h!==null);w===null?v=w=c:w=w.next=c}else v=w=c;h={baseState:g.baseState,firstBaseUpdate:v,lastBaseUpdate:w,shared:g.shared,effects:g.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}function Bl(a,c,h,g){var v=a.updateQueue;nr=!1;var w=v.firstBaseUpdate,T=v.lastBaseUpdate,O=v.shared.pending;if(O!==null){v.shared.pending=null;var H=O,X=H.next;H.next=null,T===null?w=X:T.next=X,T=H;var ae=a.alternate;ae!==null&&(ae=ae.updateQueue,O=ae.lastBaseUpdate,O!==T&&(O===null?ae.firstBaseUpdate=X:O.next=X,ae.lastBaseUpdate=H))}if(w!==null){var ce=v.baseState;T=0,ae=X=H=null,O=w;do{var ie=O.lane,me=O.eventTime;if((g&ie)===ie){ae!==null&&(ae=ae.next={eventTime:me,lane:0,tag:O.tag,payload:O.payload,callback:O.callback,next:null});e:{var ke=a,be=O;switch(ie=c,me=h,be.tag){case 1:if(ke=be.payload,typeof ke=="function"){ce=ke.call(me,ce,ie);break e}ce=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=be.payload,ie=typeof ke=="function"?ke.call(me,ce,ie):ke,ie==null)break e;ce=P({},ce,ie);break e;case 2:nr=!0}}O.callback!==null&&O.lane!==0&&(a.flags|=64,ie=v.effects,ie===null?v.effects=[O]:ie.push(O))}else me={eventTime:me,lane:ie,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ae===null?(X=ae=me,H=ce):ae=ae.next=me,T|=ie;if(O=O.next,O===null){if(O=v.shared.pending,O===null)break;ie=O,O=ie.next,ie.next=null,v.lastBaseUpdate=ie,v.shared.pending=null}}while(!0);if(ae===null&&(H=ce),v.baseState=H,v.firstBaseUpdate=X,v.lastBaseUpdate=ae,c=v.shared.interleaved,c!==null){v=c;do T|=v.lane,v=v.next;while(v!==c)}else w===null&&(v.shared.lanes=0);Ar|=T,a.lanes=T,a.memoizedState=ce}}function Vg(a,c,h){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var g=a[c],v=g.callback;if(v!==null){if(g.callback=null,g=h,typeof v!="function")throw Error(s(191,v));v.call(g)}}}var Fa={},ds=Js(Fa),za=Js(Fa),La=Js(Fa);function Tr(a){if(a===Fa)throw Error(s(174));return a}function Kd(a,c){switch(tt(La,c),tt(za,a),tt(ds,Fa),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:ue(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=ue(c,a)}it(ds),tt(ds,c)}function $i(){it(ds),it(za),it(La)}function Kg(a){Tr(La.current);var c=Tr(ds.current),h=ue(c,a.type);c!==h&&(tt(za,a),tt(ds,h))}function Yd(a){za.current===a&&(it(ds),it(za))}var ut=Js(0);function Wl(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Gd=[];function Qd(){for(var a=0;a<Gd.length;a++)Gd[a]._workInProgressVersionPrimary=null;Gd.length=0}var Ul=A.ReactCurrentDispatcher,Zd=A.ReactCurrentBatchConfig,Er=0,dt=null,$t=null,Rt=null,Hl=!1,Ma=!1,qa=0,N4=0;function Dt(){throw Error(s(321))}function Xd(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!Yn(a[h],c[h]))return!1;return!0}function Jd(a,c,h,g,v,w){if(Er=w,dt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Ul.current=a===null||a.memoizedState===null?T4:E4,a=h(g,v),Ma){w=0;do{if(Ma=!1,qa=0,25<=w)throw Error(s(301));w+=1,Rt=$t=null,c.updateQueue=null,Ul.current=A4,a=h(g,v)}while(Ma)}if(Ul.current=Yl,c=$t!==null&&$t.next!==null,Er=0,Rt=$t=dt=null,Hl=!1,c)throw Error(s(300));return a}function eh(){var a=qa!==0;return qa=0,a}function hs(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?dt.memoizedState=Rt=a:Rt=Rt.next=a,Rt}function Ln(){if($t===null){var a=dt.alternate;a=a!==null?a.memoizedState:null}else a=$t.next;var c=Rt===null?dt.memoizedState:Rt.next;if(c!==null)Rt=c,$t=a;else{if(a===null)throw Error(s(310));$t=a,a={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Rt===null?dt.memoizedState=Rt=a:Rt=Rt.next=a}return Rt}function Oa(a,c){return typeof c=="function"?c(a):c}function th(a){var c=Ln(),h=c.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=a;var g=$t,v=g.baseQueue,w=h.pending;if(w!==null){if(v!==null){var T=v.next;v.next=w.next,w.next=T}g.baseQueue=v=w,h.pending=null}if(v!==null){w=v.next,g=g.baseState;var O=T=null,H=null,X=w;do{var ae=X.lane;if((Er&ae)===ae)H!==null&&(H=H.next={lane:0,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),g=X.hasEagerState?X.eagerState:a(g,X.action);else{var ce={lane:ae,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null};H===null?(O=H=ce,T=g):H=H.next=ce,dt.lanes|=ae,Ar|=ae}X=X.next}while(X!==null&&X!==w);H===null?T=g:H.next=O,Yn(g,c.memoizedState)||(rn=!0),c.memoizedState=g,c.baseState=T,c.baseQueue=H,h.lastRenderedState=g}if(a=h.interleaved,a!==null){v=a;do w=v.lane,dt.lanes|=w,Ar|=w,v=v.next;while(v!==a)}else v===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function nh(a){var c=Ln(),h=c.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=a;var g=h.dispatch,v=h.pending,w=c.memoizedState;if(v!==null){h.pending=null;var T=v=v.next;do w=a(w,T.action),T=T.next;while(T!==v);Yn(w,c.memoizedState)||(rn=!0),c.memoizedState=w,c.baseQueue===null&&(c.baseState=w),h.lastRenderedState=w}return[w,g]}function Yg(){}function Gg(a,c){var h=dt,g=Ln(),v=c(),w=!Yn(g.memoizedState,v);if(w&&(g.memoizedState=v,rn=!0),g=g.queue,sh(Xg.bind(null,h,g,a),[a]),g.getSnapshot!==c||w||Rt!==null&&Rt.memoizedState.tag&1){if(h.flags|=2048,_a(9,Zg.bind(null,h,g,v,c),void 0,null),It===null)throw Error(s(349));(Er&30)!==0||Qg(h,c,v)}return v}function Qg(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=dt.updateQueue,c===null?(c={lastEffect:null,stores:null},dt.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function Zg(a,c,h,g){c.value=h,c.getSnapshot=g,Jg(c)&&e0(a)}function Xg(a,c,h){return h(function(){Jg(c)&&e0(a)})}function Jg(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!Yn(a,h)}catch{return!0}}function e0(a){var c=Es(a,1);c!==null&&Jn(c,a,1,-1)}function t0(a){var c=hs();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:a},c.queue=a,a=a.dispatch=$4.bind(null,dt,a),[c.memoizedState,a]}function _a(a,c,h,g){return a={tag:a,create:c,destroy:h,deps:g,next:null},c=dt.updateQueue,c===null?(c={lastEffect:null,stores:null},dt.updateQueue=c,c.lastEffect=a.next=a):(h=c.lastEffect,h===null?c.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,c.lastEffect=a)),a}function n0(){return Ln().memoizedState}function Vl(a,c,h,g){var v=hs();dt.flags|=a,v.memoizedState=_a(1|c,h,void 0,g===void 0?null:g)}function Kl(a,c,h,g){var v=Ln();g=g===void 0?null:g;var w=void 0;if($t!==null){var T=$t.memoizedState;if(w=T.destroy,g!==null&&Xd(g,T.deps)){v.memoizedState=_a(c,h,w,g);return}}dt.flags|=a,v.memoizedState=_a(1|c,h,w,g)}function s0(a,c){return Vl(8390656,8,a,c)}function sh(a,c){return Kl(2048,8,a,c)}function r0(a,c){return Kl(4,2,a,c)}function i0(a,c){return Kl(4,4,a,c)}function a0(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function o0(a,c,h){return h=h!=null?h.concat([a]):null,Kl(4,4,a0.bind(null,c,a),h)}function rh(){}function l0(a,c){var h=Ln();c=c===void 0?null:c;var g=h.memoizedState;return g!==null&&c!==null&&Xd(c,g[1])?g[0]:(h.memoizedState=[a,c],a)}function c0(a,c){var h=Ln();c=c===void 0?null:c;var g=h.memoizedState;return g!==null&&c!==null&&Xd(c,g[1])?g[0]:(a=a(),h.memoizedState=[a,c],a)}function u0(a,c,h){return(Er&21)===0?(a.baseState&&(a.baseState=!1,rn=!0),a.memoizedState=h):(Yn(h,c)||(h=_1(),dt.lanes|=h,Ar|=h,a.baseState=!0),c)}function S4(a,c){var h=Xe;Xe=h!==0&&4>h?h:4,a(!0);var g=Zd.transition;Zd.transition={};try{a(!1),c()}finally{Xe=h,Zd.transition=g}}function d0(){return Ln().memoizedState}function C4(a,c,h){var g=or(a);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},h0(a))p0(c,h);else if(h=Wg(a,c,h,g),h!==null){var v=Jt();Jn(h,a,g,v),f0(h,c,g)}}function $4(a,c,h){var g=or(a),v={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(h0(a))p0(c,v);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=c.lastRenderedReducer,w!==null))try{var T=c.lastRenderedState,O=w(T,h);if(v.hasEagerState=!0,v.eagerState=O,Yn(O,T)){var H=c.interleaved;H===null?(v.next=v,Hd(c)):(v.next=H.next,H.next=v),c.interleaved=v;return}}catch{}finally{}h=Wg(a,c,v,g),h!==null&&(v=Jt(),Jn(h,a,g,v),f0(h,c,g))}}function h0(a){var c=a.alternate;return a===dt||c!==null&&c===dt}function p0(a,c){Ma=Hl=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function f0(a,c,h){if((h&4194240)!==0){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,ad(a,h)}}var Yl={readContext:zn,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},T4={readContext:zn,useCallback:function(a,c){return hs().memoizedState=[a,c===void 0?null:c],a},useContext:zn,useEffect:s0,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,Vl(4194308,4,a0.bind(null,c,a),h)},useLayoutEffect:function(a,c){return Vl(4194308,4,a,c)},useInsertionEffect:function(a,c){return Vl(4,2,a,c)},useMemo:function(a,c){var h=hs();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var g=hs();return c=h!==void 0?h(c):c,g.memoizedState=g.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},g.queue=a,a=a.dispatch=C4.bind(null,dt,a),[g.memoizedState,a]},useRef:function(a){var c=hs();return a={current:a},c.memoizedState=a},useState:t0,useDebugValue:rh,useDeferredValue:function(a){return hs().memoizedState=a},useTransition:function(){var a=t0(!1),c=a[0];return a=S4.bind(null,a[1]),hs().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var g=dt,v=hs();if(ot){if(h===void 0)throw Error(s(407));h=h()}else{if(h=c(),It===null)throw Error(s(349));(Er&30)!==0||Qg(g,c,h)}v.memoizedState=h;var w={value:h,getSnapshot:c};return v.queue=w,s0(Xg.bind(null,g,w,a),[a]),g.flags|=2048,_a(9,Zg.bind(null,g,w,h,c),void 0,null),h},useId:function(){var a=hs(),c=It.identifierPrefix;if(ot){var h=Ts,g=$s;h=(g&~(1<<32-Kn(g)-1)).toString(32)+h,c=":"+c+"R"+h,h=qa++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=N4++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},E4={readContext:zn,useCallback:l0,useContext:zn,useEffect:sh,useImperativeHandle:o0,useInsertionEffect:r0,useLayoutEffect:i0,useMemo:c0,useReducer:th,useRef:n0,useState:function(){return th(Oa)},useDebugValue:rh,useDeferredValue:function(a){var c=Ln();return u0(c,$t.memoizedState,a)},useTransition:function(){var a=th(Oa)[0],c=Ln().memoizedState;return[a,c]},useMutableSource:Yg,useSyncExternalStore:Gg,useId:d0,unstable_isNewReconciler:!1},A4={readContext:zn,useCallback:l0,useContext:zn,useEffect:sh,useImperativeHandle:o0,useInsertionEffect:r0,useLayoutEffect:i0,useMemo:c0,useReducer:nh,useRef:n0,useState:function(){return nh(Oa)},useDebugValue:rh,useDeferredValue:function(a){var c=Ln();return $t===null?c.memoizedState=a:u0(c,$t.memoizedState,a)},useTransition:function(){var a=nh(Oa)[0],c=Ln().memoizedState;return[a,c]},useMutableSource:Yg,useSyncExternalStore:Gg,useId:d0,unstable_isNewReconciler:!1};function Qn(a,c){if(a&&a.defaultProps){c=P({},c),a=a.defaultProps;for(var h in a)c[h]===void 0&&(c[h]=a[h]);return c}return c}function ih(a,c,h,g){c=a.memoizedState,h=h(g,c),h=h==null?c:P({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Gl={isMounted:function(a){return(a=a._reactInternals)?br(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var g=Jt(),v=or(a),w=As(g,v);w.payload=c,h!=null&&(w.callback=h),c=sr(a,w,v),c!==null&&(Jn(c,a,v,g),Dl(c,a,v))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var g=Jt(),v=or(a),w=As(g,v);w.tag=1,w.payload=c,h!=null&&(w.callback=h),c=sr(a,w,v),c!==null&&(Jn(c,a,v,g),Dl(c,a,v))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Jt(),g=or(a),v=As(h,g);v.tag=2,c!=null&&(v.callback=c),c=sr(a,v,g),c!==null&&(Jn(c,a,g,h),Dl(c,a,g))}};function m0(a,c,h,g,v,w,T){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,w,T):c.prototype&&c.prototype.isPureReactComponent?!Ca(h,g)||!Ca(v,w):!0}function g0(a,c,h){var g=!1,v=er,w=c.contextType;return typeof w=="object"&&w!==null?w=zn(w):(v=sn(c)?Nr:_t.current,g=c.contextTypes,w=(g=g!=null)?ki(a,v):er),c=new c(h,w),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Gl,a.stateNode=c,c._reactInternals=a,g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=v,a.__reactInternalMemoizedMaskedChildContext=w),c}function x0(a,c,h,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==a&&Gl.enqueueReplaceState(c,c.state,null)}function ah(a,c,h,g){var v=a.stateNode;v.props=h,v.state=a.memoizedState,v.refs={},Vd(a);var w=c.contextType;typeof w=="object"&&w!==null?v.context=zn(w):(w=sn(c)?Nr:_t.current,v.context=ki(a,w)),v.state=a.memoizedState,w=c.getDerivedStateFromProps,typeof w=="function"&&(ih(a,c,w,h),v.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(c=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),c!==v.state&&Gl.enqueueReplaceState(v,v.state,null),Bl(a,h,v,g),v.state=a.memoizedState),typeof v.componentDidMount=="function"&&(a.flags|=4194308)}function Ti(a,c){try{var h="",g=c;do h+=fe(g),g=g.return;while(g);var v=h}catch(w){v=`
39
+ Error generating stack: `+w.message+`
40
+ `+w.stack}return{value:a,source:c,stack:v,digest:null}}function oh(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function lh(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var P4=typeof WeakMap=="function"?WeakMap:Map;function y0(a,c,h){h=As(-1,h),h.tag=3,h.payload={element:null};var g=c.value;return h.callback=function(){nc||(nc=!0,wh=g),lh(a,c)},h}function j0(a,c,h){h=As(-1,h),h.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var v=c.value;h.payload=function(){return g(v)},h.callback=function(){lh(a,c)}}var w=a.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(h.callback=function(){lh(a,c),typeof g!="function"&&(ir===null?ir=new Set([this]):ir.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})}),h}function k0(a,c,h){var g=a.pingCache;if(g===null){g=a.pingCache=new P4;var v=new Set;g.set(c,v)}else v=g.get(c),v===void 0&&(v=new Set,g.set(c,v));v.has(h)||(v.add(h),a=H4.bind(null,a,c,h),c.then(a,a))}function v0(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function b0(a,c,h,g,v){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=As(-1,1),c.tag=2,sr(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=v,a)}var R4=A.ReactCurrentOwner,rn=!1;function Xt(a,c,h,g){c.child=a===null?Bg(c,null,h,g):Ni(c,a.child,h,g)}function w0(a,c,h,g,v){h=h.render;var w=c.ref;return Ci(c,v),g=Jd(a,c,h,g,w,v),h=eh(),a!==null&&!rn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~v,Ps(a,c,v)):(ot&&h&&Ld(c),c.flags|=1,Xt(a,c,g,v),c.child)}function N0(a,c,h,g,v){if(a===null){var w=h.type;return typeof w=="function"&&!Ah(w)&&w.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=w,S0(a,c,w,g,v)):(a=lc(h.type,null,g,c,c.mode,v),a.ref=c.ref,a.return=c,c.child=a)}if(w=a.child,(a.lanes&v)===0){var T=w.memoizedProps;if(h=h.compare,h=h!==null?h:Ca,h(T,g)&&a.ref===c.ref)return Ps(a,c,v)}return c.flags|=1,a=cr(w,g),a.ref=c.ref,a.return=c,c.child=a}function S0(a,c,h,g,v){if(a!==null){var w=a.memoizedProps;if(Ca(w,g)&&a.ref===c.ref)if(rn=!1,c.pendingProps=g=w,(a.lanes&v)!==0)(a.flags&131072)!==0&&(rn=!0);else return c.lanes=a.lanes,Ps(a,c,v)}return ch(a,c,h,g,v)}function C0(a,c,h){var g=c.pendingProps,v=g.children,w=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(Ai,jn),jn|=h;else{if((h&1073741824)===0)return a=w!==null?w.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,tt(Ai,jn),jn|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=w!==null?w.baseLanes:h,tt(Ai,jn),jn|=g}else w!==null?(g=w.baseLanes|h,c.memoizedState=null):g=h,tt(Ai,jn),jn|=g;return Xt(a,c,v,h),c.child}function $0(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function ch(a,c,h,g,v){var w=sn(h)?Nr:_t.current;return w=ki(c,w),Ci(c,v),h=Jd(a,c,h,g,w,v),g=eh(),a!==null&&!rn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~v,Ps(a,c,v)):(ot&&g&&Ld(c),c.flags|=1,Xt(a,c,h,v),c.child)}function T0(a,c,h,g,v){if(sn(h)){var w=!0;Il(c)}else w=!1;if(Ci(c,v),c.stateNode===null)Zl(a,c),g0(c,h,g),ah(c,h,g,v),g=!0;else if(a===null){var T=c.stateNode,O=c.memoizedProps;T.props=O;var H=T.context,X=h.contextType;typeof X=="object"&&X!==null?X=zn(X):(X=sn(h)?Nr:_t.current,X=ki(c,X));var ae=h.getDerivedStateFromProps,ce=typeof ae=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(O!==g||H!==X)&&x0(c,T,g,X),nr=!1;var ie=c.memoizedState;T.state=ie,Bl(c,g,T,v),H=c.memoizedState,O!==g||ie!==H||nn.current||nr?(typeof ae=="function"&&(ih(c,h,ae,g),H=c.memoizedState),(O=nr||m0(c,h,O,g,ie,H,X))?(ce||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(c.flags|=4194308)):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=H),T.props=g,T.state=H,T.context=X,g=O):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{T=c.stateNode,Ug(a,c),O=c.memoizedProps,X=c.type===c.elementType?O:Qn(c.type,O),T.props=X,ce=c.pendingProps,ie=T.context,H=h.contextType,typeof H=="object"&&H!==null?H=zn(H):(H=sn(h)?Nr:_t.current,H=ki(c,H));var me=h.getDerivedStateFromProps;(ae=typeof me=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(O!==ce||ie!==H)&&x0(c,T,g,H),nr=!1,ie=c.memoizedState,T.state=ie,Bl(c,g,T,v);var ke=c.memoizedState;O!==ce||ie!==ke||nn.current||nr?(typeof me=="function"&&(ih(c,h,me,g),ke=c.memoizedState),(X=nr||m0(c,h,X,g,ie,ke,H)||!1)?(ae||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,ke,H),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,ke,H)),typeof T.componentDidUpdate=="function"&&(c.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof T.componentDidUpdate!="function"||O===a.memoizedProps&&ie===a.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&ie===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=ke),T.props=g,T.state=ke,T.context=H,g=X):(typeof T.componentDidUpdate!="function"||O===a.memoizedProps&&ie===a.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&ie===a.memoizedState||(c.flags|=1024),g=!1)}return uh(a,c,h,g,w,v)}function uh(a,c,h,g,v,w){$0(a,c);var T=(c.flags&128)!==0;if(!g&&!T)return v&&Ig(c,h,!1),Ps(a,c,w);g=c.stateNode,R4.current=c;var O=T&&typeof h.getDerivedStateFromError!="function"?null:g.render();return c.flags|=1,a!==null&&T?(c.child=Ni(c,a.child,null,w),c.child=Ni(c,null,O,w)):Xt(a,c,O,w),c.memoizedState=g.state,v&&Ig(c,h,!0),c.child}function E0(a){var c=a.stateNode;c.pendingContext?Pg(a,c.pendingContext,c.pendingContext!==c.context):c.context&&Pg(a,c.context,!1),Kd(a,c.containerInfo)}function A0(a,c,h,g,v){return wi(),_d(v),c.flags|=256,Xt(a,c,h,g),c.child}var dh={dehydrated:null,treeContext:null,retryLane:0};function hh(a){return{baseLanes:a,cachePool:null,transitions:null}}function P0(a,c,h){var g=c.pendingProps,v=ut.current,w=!1,T=(c.flags&128)!==0,O;if((O=T)||(O=a!==null&&a.memoizedState===null?!1:(v&2)!==0),O?(w=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(v|=1),tt(ut,v&1),a===null)return Od(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(T=g.children,a=g.fallback,w?(g=c.mode,w=c.child,T={mode:"hidden",children:T},(g&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=T):w=cc(T,g,0,null),a=Fr(a,g,h,null),w.return=c,a.return=c,w.sibling=a,c.child=w,c.child.memoizedState=hh(h),c.memoizedState=dh,a):ph(c,T));if(v=a.memoizedState,v!==null&&(O=v.dehydrated,O!==null))return I4(a,c,T,g,O,v,h);if(w){w=g.fallback,T=c.mode,v=a.child,O=v.sibling;var H={mode:"hidden",children:g.children};return(T&1)===0&&c.child!==v?(g=c.child,g.childLanes=0,g.pendingProps=H,c.deletions=null):(g=cr(v,H),g.subtreeFlags=v.subtreeFlags&14680064),O!==null?w=cr(O,w):(w=Fr(w,T,h,null),w.flags|=2),w.return=c,g.return=c,g.sibling=w,c.child=g,g=w,w=c.child,T=a.child.memoizedState,T=T===null?hh(h):{baseLanes:T.baseLanes|h,cachePool:null,transitions:T.transitions},w.memoizedState=T,w.childLanes=a.childLanes&~h,c.memoizedState=dh,g}return w=a.child,a=w.sibling,g=cr(w,{mode:"visible",children:g.children}),(c.mode&1)===0&&(g.lanes=h),g.return=c,g.sibling=null,a!==null&&(h=c.deletions,h===null?(c.deletions=[a],c.flags|=16):h.push(a)),c.child=g,c.memoizedState=null,g}function ph(a,c){return c=cc({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Ql(a,c,h,g){return g!==null&&_d(g),Ni(c,a.child,null,h),a=ph(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function I4(a,c,h,g,v,w,T){if(h)return c.flags&256?(c.flags&=-257,g=oh(Error(s(422))),Ql(a,c,T,g)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(w=g.fallback,v=c.mode,g=cc({mode:"visible",children:g.children},v,0,null),w=Fr(w,v,T,null),w.flags|=2,g.return=c,w.return=c,g.sibling=w,c.child=g,(c.mode&1)!==0&&Ni(c,a.child,null,T),c.child.memoizedState=hh(T),c.memoizedState=dh,w);if((c.mode&1)===0)return Ql(a,c,T,null);if(v.data==="$!"){if(g=v.nextSibling&&v.nextSibling.dataset,g)var O=g.dgst;return g=O,w=Error(s(419)),g=oh(w,g,void 0),Ql(a,c,T,g)}if(O=(T&a.childLanes)!==0,rn||O){if(g=It,g!==null){switch(T&-T){case 4:v=2;break;case 16:v=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(g.suspendedLanes|T))!==0?0:v,v!==0&&v!==w.retryLane&&(w.retryLane=v,Es(a,v),Jn(g,a,v,-1))}return Eh(),g=oh(Error(s(421))),Ql(a,c,T,g)}return v.data==="$?"?(c.flags|=128,c.child=a.child,c=V4.bind(null,a),v._reactRetry=c,null):(a=w.treeContext,yn=Xs(v.nextSibling),xn=c,ot=!0,Gn=null,a!==null&&(In[Fn++]=$s,In[Fn++]=Ts,In[Fn++]=Sr,$s=a.id,Ts=a.overflow,Sr=c),c=ph(c,g.children),c.flags|=4096,c)}function R0(a,c,h){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),Ud(a.return,c,h)}function fh(a,c,h,g,v){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:v}:(w.isBackwards=c,w.rendering=null,w.renderingStartTime=0,w.last=g,w.tail=h,w.tailMode=v)}function I0(a,c,h){var g=c.pendingProps,v=g.revealOrder,w=g.tail;if(Xt(a,c,g.children,h),g=ut.current,(g&2)!==0)g=g&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&R0(a,h,c);else if(a.tag===19)R0(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(tt(ut,g),(c.mode&1)===0)c.memoizedState=null;else switch(v){case"forwards":for(h=c.child,v=null;h!==null;)a=h.alternate,a!==null&&Wl(a)===null&&(v=h),h=h.sibling;h=v,h===null?(v=c.child,c.child=null):(v=h.sibling,h.sibling=null),fh(c,!1,v,h,w);break;case"backwards":for(h=null,v=c.child,c.child=null;v!==null;){if(a=v.alternate,a!==null&&Wl(a)===null){c.child=v;break}a=v.sibling,v.sibling=h,h=v,v=a}fh(c,!0,h,null,w);break;case"together":fh(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Zl(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function Ps(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),Ar|=c.lanes,(h&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(s(153));if(c.child!==null){for(a=c.child,h=cr(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=cr(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function F4(a,c,h){switch(c.tag){case 3:E0(c),wi();break;case 5:Kg(c);break;case 1:sn(c.type)&&Il(c);break;case 4:Kd(c,c.stateNode.containerInfo);break;case 10:var g=c.type._context,v=c.memoizedProps.value;tt(Ol,g._currentValue),g._currentValue=v;break;case 13:if(g=c.memoizedState,g!==null)return g.dehydrated!==null?(tt(ut,ut.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?P0(a,c,h):(tt(ut,ut.current&1),a=Ps(a,c,h),a!==null?a.sibling:null);tt(ut,ut.current&1);break;case 19:if(g=(h&c.childLanes)!==0,(a.flags&128)!==0){if(g)return I0(a,c,h);c.flags|=128}if(v=c.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),tt(ut,ut.current),g)break;return null;case 22:case 23:return c.lanes=0,C0(a,c,h)}return Ps(a,c,h)}var F0,mh,z0,L0;F0=function(a,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},mh=function(){},z0=function(a,c,h,g){var v=a.memoizedProps;if(v!==g){a=c.stateNode,Tr(ds.current);var w=null;switch(h){case"input":v=Zt(a,v),g=Zt(a,g),w=[];break;case"select":v=P({},v,{value:void 0}),g=P({},g,{value:void 0}),w=[];break;case"textarea":v=Pn(a,v),g=Pn(a,g),w=[];break;default:typeof v.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=Al)}st(h,g);var T;h=null;for(X in v)if(!g.hasOwnProperty(X)&&v.hasOwnProperty(X)&&v[X]!=null)if(X==="style"){var O=v[X];for(T in O)O.hasOwnProperty(T)&&(h||(h={}),h[T]="")}else X!=="dangerouslySetInnerHTML"&&X!=="children"&&X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&X!=="autoFocus"&&(i.hasOwnProperty(X)?w||(w=[]):(w=w||[]).push(X,null));for(X in g){var H=g[X];if(O=v?.[X],g.hasOwnProperty(X)&&H!==O&&(H!=null||O!=null))if(X==="style")if(O){for(T in O)!O.hasOwnProperty(T)||H&&H.hasOwnProperty(T)||(h||(h={}),h[T]="");for(T in H)H.hasOwnProperty(T)&&O[T]!==H[T]&&(h||(h={}),h[T]=H[T])}else h||(w||(w=[]),w.push(X,h)),h=H;else X==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,O=O?O.__html:void 0,H!=null&&O!==H&&(w=w||[]).push(X,H)):X==="children"?typeof H!="string"&&typeof H!="number"||(w=w||[]).push(X,""+H):X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&(i.hasOwnProperty(X)?(H!=null&&X==="onScroll"&&rt("scroll",a),w||O===H||(w=[])):(w=w||[]).push(X,H))}h&&(w=w||[]).push("style",h);var X=w;(c.updateQueue=X)&&(c.flags|=4)}},L0=function(a,c,h,g){h!==g&&(c.flags|=4)};function Da(a,c){if(!ot)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function Bt(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(c)for(var v=a.child;v!==null;)h|=v.lanes|v.childLanes,g|=v.subtreeFlags&14680064,g|=v.flags&14680064,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)h|=v.lanes|v.childLanes,g|=v.subtreeFlags,g|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=g,a.childLanes=h,c}function z4(a,c,h){var g=c.pendingProps;switch(Md(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(c),null;case 1:return sn(c.type)&&Rl(),Bt(c),null;case 3:return g=c.stateNode,$i(),it(nn),it(_t),Qd(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(Ml(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Gn!==null&&(Ch(Gn),Gn=null))),mh(a,c),Bt(c),null;case 5:Yd(c);var v=Tr(La.current);if(h=c.type,a!==null&&c.stateNode!=null)z0(a,c,h,g,v),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!g){if(c.stateNode===null)throw Error(s(166));return Bt(c),null}if(a=Tr(ds.current),Ml(c)){g=c.stateNode,h=c.type;var w=c.memoizedProps;switch(g[us]=c,g[Pa]=w,a=(c.mode&1)!==0,h){case"dialog":rt("cancel",g),rt("close",g);break;case"iframe":case"object":case"embed":rt("load",g);break;case"video":case"audio":for(v=0;v<Ta.length;v++)rt(Ta[v],g);break;case"source":rt("error",g);break;case"img":case"image":case"link":rt("error",g),rt("load",g);break;case"details":rt("toggle",g);break;case"input":Tn(g,w),rt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!w.multiple},rt("invalid",g);break;case"textarea":Hs(g,w),rt("invalid",g)}st(h,w),v=null;for(var T in w)if(w.hasOwnProperty(T)){var O=w[T];T==="children"?typeof O=="string"?g.textContent!==O&&(w.suppressHydrationWarning!==!0&&El(g.textContent,O,a),v=["children",O]):typeof O=="number"&&g.textContent!==""+O&&(w.suppressHydrationWarning!==!0&&El(g.textContent,O,a),v=["children",""+O]):i.hasOwnProperty(T)&&O!=null&&T==="onScroll"&&rt("scroll",g)}switch(h){case"input":Ot(g),Pt(g,w,!0);break;case"textarea":Ot(g),Ge(g);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(g.onclick=Al)}g=v,c.updateQueue=g,g!==null&&(c.flags|=4)}else{T=v.nodeType===9?v:v.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ee(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=T.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=T.createElement(h,{is:g.is}):(a=T.createElement(h),h==="select"&&(T=a,g.multiple?T.multiple=!0:g.size&&(T.size=g.size))):a=T.createElementNS(a,h),a[us]=c,a[Pa]=g,F0(a,c,!1,!1),c.stateNode=a;e:{switch(T=xt(h,g),h){case"dialog":rt("cancel",a),rt("close",a),v=g;break;case"iframe":case"object":case"embed":rt("load",a),v=g;break;case"video":case"audio":for(v=0;v<Ta.length;v++)rt(Ta[v],a);v=g;break;case"source":rt("error",a),v=g;break;case"img":case"image":case"link":rt("error",a),rt("load",a),v=g;break;case"details":rt("toggle",a),v=g;break;case"input":Tn(a,g),v=Zt(a,g),rt("invalid",a);break;case"option":v=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},v=P({},g,{value:void 0}),rt("invalid",a);break;case"textarea":Hs(a,g),v=Pn(a,g),rt("invalid",a);break;default:v=g}st(h,v),O=v;for(w in O)if(O.hasOwnProperty(w)){var H=O[w];w==="style"?se(a,H):w==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&Oe(a,H)):w==="children"?typeof H=="string"?(h!=="textarea"||H!=="")&&We(a,H):typeof H=="number"&&We(a,""+H):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(i.hasOwnProperty(w)?H!=null&&w==="onScroll"&&rt("scroll",a):H!=null&&$(a,w,H,T))}switch(h){case"input":Ot(a),Pt(a,g,!1);break;case"textarea":Ot(a),Ge(a);break;case"option":g.value!=null&&a.setAttribute("value",""+Ie(g.value));break;case"select":a.multiple=!!g.multiple,w=g.value,w!=null?An(a,!!g.multiple,w,!1):g.defaultValue!=null&&An(a,!!g.multiple,g.defaultValue,!0);break;default:typeof v.onClick=="function"&&(a.onclick=Al)}switch(h){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Bt(c),null;case 6:if(a&&c.stateNode!=null)L0(a,c,a.memoizedProps,g);else{if(typeof g!="string"&&c.stateNode===null)throw Error(s(166));if(h=Tr(La.current),Tr(ds.current),Ml(c)){if(g=c.stateNode,h=c.memoizedProps,g[us]=c,(w=g.nodeValue!==h)&&(a=xn,a!==null))switch(a.tag){case 3:El(g.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&El(g.nodeValue,h,(a.mode&1)!==0)}w&&(c.flags|=4)}else g=(h.nodeType===9?h:h.ownerDocument).createTextNode(g),g[us]=c,c.stateNode=g}return Bt(c),null;case 13:if(it(ut),g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(ot&&yn!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Og(),wi(),c.flags|=98560,w=!1;else if(w=Ml(c),g!==null&&g.dehydrated!==null){if(a===null){if(!w)throw Error(s(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(s(317));w[us]=c}else wi(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Bt(c),w=!1}else Gn!==null&&(Ch(Gn),Gn=null),w=!0;if(!w)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(ut.current&1)!==0?Tt===0&&(Tt=3):Eh())),c.updateQueue!==null&&(c.flags|=4),Bt(c),null);case 4:return $i(),mh(a,c),a===null&&Ea(c.stateNode.containerInfo),Bt(c),null;case 10:return Wd(c.type._context),Bt(c),null;case 17:return sn(c.type)&&Rl(),Bt(c),null;case 19:if(it(ut),w=c.memoizedState,w===null)return Bt(c),null;if(g=(c.flags&128)!==0,T=w.rendering,T===null)if(g)Da(w,!1);else{if(Tt!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(T=Wl(a),T!==null){for(c.flags|=128,Da(w,!1),g=T.updateQueue,g!==null&&(c.updateQueue=g,c.flags|=4),c.subtreeFlags=0,g=h,h=c.child;h!==null;)w=h,a=g,w.flags&=14680066,T=w.alternate,T===null?(w.childLanes=0,w.lanes=a,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=T.childLanes,w.lanes=T.lanes,w.child=T.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=T.memoizedProps,w.memoizedState=T.memoizedState,w.updateQueue=T.updateQueue,w.type=T.type,a=T.dependencies,w.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return tt(ut,ut.current&1|2),c.child}a=a.sibling}w.tail!==null&&yt()>Pi&&(c.flags|=128,g=!0,Da(w,!1),c.lanes=4194304)}else{if(!g)if(a=Wl(T),a!==null){if(c.flags|=128,g=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Da(w,!0),w.tail===null&&w.tailMode==="hidden"&&!T.alternate&&!ot)return Bt(c),null}else 2*yt()-w.renderingStartTime>Pi&&h!==1073741824&&(c.flags|=128,g=!0,Da(w,!1),c.lanes=4194304);w.isBackwards?(T.sibling=c.child,c.child=T):(h=w.last,h!==null?h.sibling=T:c.child=T,w.last=T)}return w.tail!==null?(c=w.tail,w.rendering=c,w.tail=c.sibling,w.renderingStartTime=yt(),c.sibling=null,h=ut.current,tt(ut,g?h&1|2:h&1),c):(Bt(c),null);case 22:case 23:return Th(),g=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(c.flags|=8192),g&&(c.mode&1)!==0?(jn&1073741824)!==0&&(Bt(c),c.subtreeFlags&6&&(c.flags|=8192)):Bt(c),null;case 24:return null;case 25:return null}throw Error(s(156,c.tag))}function L4(a,c){switch(Md(c),c.tag){case 1:return sn(c.type)&&Rl(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return $i(),it(nn),it(_t),Qd(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Yd(c),null;case 13:if(it(ut),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(s(340));wi()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return it(ut),null;case 4:return $i(),null;case 10:return Wd(c.type._context),null;case 22:case 23:return Th(),null;case 24:return null;default:return null}}var Xl=!1,Wt=!1,M4=typeof WeakSet=="function"?WeakSet:Set,je=null;function Ei(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){ft(a,c,g)}else h.current=null}function gh(a,c,h){try{h()}catch(g){ft(a,c,g)}}var M0=!1;function q4(a,c){if(Td=yl,a=mg(),kd(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var v=g.anchorOffset,w=g.focusNode;g=g.focusOffset;try{h.nodeType,w.nodeType}catch{h=null;break e}var T=0,O=-1,H=-1,X=0,ae=0,ce=a,ie=null;t:for(;;){for(var me;ce!==h||v!==0&&ce.nodeType!==3||(O=T+v),ce!==w||g!==0&&ce.nodeType!==3||(H=T+g),ce.nodeType===3&&(T+=ce.nodeValue.length),(me=ce.firstChild)!==null;)ie=ce,ce=me;for(;;){if(ce===a)break t;if(ie===h&&++X===v&&(O=T),ie===w&&++ae===g&&(H=T),(me=ce.nextSibling)!==null)break;ce=ie,ie=ce.parentNode}ce=me}h=O===-1||H===-1?null:{start:O,end:H}}else h=null}h=h||{start:0,end:0}}else h=null;for(Ed={focusedElem:a,selectionRange:h},yl=!1,je=c;je!==null;)if(c=je,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,je=a;else for(;je!==null;){c=je;try{var ke=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var be=ke.memoizedProps,jt=ke.memoizedState,Q=c.stateNode,K=Q.getSnapshotBeforeUpdate(c.elementType===c.type?be:Qn(c.type,be),jt);Q.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var Z=c.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(he){ft(c,c.return,he)}if(a=c.sibling,a!==null){a.return=c.return,je=a;break}je=c.return}return ke=M0,M0=!1,ke}function Ba(a,c,h){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var v=g=g.next;do{if((v.tag&a)===a){var w=v.destroy;v.destroy=void 0,w!==void 0&&gh(c,h,w)}v=v.next}while(v!==g)}}function Jl(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&a)===a){var g=h.create;h.destroy=g()}h=h.next}while(h!==c)}}function xh(a){var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof c=="function"?c(a):c.current=a}}function q0(a){var c=a.alternate;c!==null&&(a.alternate=null,q0(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[us],delete c[Pa],delete c[Id],delete c[k4],delete c[v4])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function O0(a){return a.tag===5||a.tag===3||a.tag===4}function _0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||O0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function yh(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(a,c):h.insertBefore(a,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(a,h)):(c=h,c.appendChild(a)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=Al));else if(g!==4&&(a=a.child,a!==null))for(yh(a,c,h),a=a.sibling;a!==null;)yh(a,c,h),a=a.sibling}function jh(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(jh(a,c,h),a=a.sibling;a!==null;)jh(a,c,h),a=a.sibling}var Lt=null,Zn=!1;function rr(a,c,h){for(h=h.child;h!==null;)D0(a,c,h),h=h.sibling}function D0(a,c,h){if(cs&&typeof cs.onCommitFiberUnmount=="function")try{cs.onCommitFiberUnmount(hl,h)}catch{}switch(h.tag){case 5:Wt||Ei(h,c);case 6:var g=Lt,v=Zn;Lt=null,rr(a,c,h),Lt=g,Zn=v,Lt!==null&&(Zn?(a=Lt,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):Lt.removeChild(h.stateNode));break;case 18:Lt!==null&&(Zn?(a=Lt,h=h.stateNode,a.nodeType===8?Rd(a.parentNode,h):a.nodeType===1&&Rd(a,h),ka(a)):Rd(Lt,h.stateNode));break;case 4:g=Lt,v=Zn,Lt=h.stateNode.containerInfo,Zn=!0,rr(a,c,h),Lt=g,Zn=v;break;case 0:case 11:case 14:case 15:if(!Wt&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){v=g=g.next;do{var w=v,T=w.destroy;w=w.tag,T!==void 0&&((w&2)!==0||(w&4)!==0)&&gh(h,c,T),v=v.next}while(v!==g)}rr(a,c,h);break;case 1:if(!Wt&&(Ei(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch(O){ft(h,c,O)}rr(a,c,h);break;case 21:rr(a,c,h);break;case 22:h.mode&1?(Wt=(g=Wt)||h.memoizedState!==null,rr(a,c,h),Wt=g):rr(a,c,h);break;default:rr(a,c,h)}}function B0(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new M4),c.forEach(function(g){var v=K4.bind(null,a,g);h.has(g)||(h.add(g),g.then(v,v))})}}function Xn(a,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var v=h[g];try{var w=a,T=c,O=T;e:for(;O!==null;){switch(O.tag){case 5:Lt=O.stateNode,Zn=!1;break e;case 3:Lt=O.stateNode.containerInfo,Zn=!0;break e;case 4:Lt=O.stateNode.containerInfo,Zn=!0;break e}O=O.return}if(Lt===null)throw Error(s(160));D0(w,T,v),Lt=null,Zn=!1;var H=v.alternate;H!==null&&(H.return=null),v.return=null}catch(X){ft(v,c,X)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)W0(c,a),c=c.sibling}function W0(a,c){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Xn(c,a),ps(a),g&4){try{Ba(3,a,a.return),Jl(3,a)}catch(be){ft(a,a.return,be)}try{Ba(5,a,a.return)}catch(be){ft(a,a.return,be)}}break;case 1:Xn(c,a),ps(a),g&512&&h!==null&&Ei(h,h.return);break;case 5:if(Xn(c,a),ps(a),g&512&&h!==null&&Ei(h,h.return),a.flags&32){var v=a.stateNode;try{We(v,"")}catch(be){ft(a,a.return,be)}}if(g&4&&(v=a.stateNode,v!=null)){var w=a.memoizedProps,T=h!==null?h.memoizedProps:w,O=a.type,H=a.updateQueue;if(a.updateQueue=null,H!==null)try{O==="input"&&w.type==="radio"&&w.name!=null&&En(v,w),xt(O,T);var X=xt(O,w);for(T=0;T<H.length;T+=2){var ae=H[T],ce=H[T+1];ae==="style"?se(v,ce):ae==="dangerouslySetInnerHTML"?Oe(v,ce):ae==="children"?We(v,ce):$(v,ae,ce,X)}switch(O){case"input":Vn(v,w);break;case"textarea":ls(v,w);break;case"select":var ie=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!w.multiple;var me=w.value;me!=null?An(v,!!w.multiple,me,!1):ie!==!!w.multiple&&(w.defaultValue!=null?An(v,!!w.multiple,w.defaultValue,!0):An(v,!!w.multiple,w.multiple?[]:"",!1))}v[Pa]=w}catch(be){ft(a,a.return,be)}}break;case 6:if(Xn(c,a),ps(a),g&4){if(a.stateNode===null)throw Error(s(162));v=a.stateNode,w=a.memoizedProps;try{v.nodeValue=w}catch(be){ft(a,a.return,be)}}break;case 3:if(Xn(c,a),ps(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{ka(c.containerInfo)}catch(be){ft(a,a.return,be)}break;case 4:Xn(c,a),ps(a);break;case 13:Xn(c,a),ps(a),v=a.child,v.flags&8192&&(w=v.memoizedState!==null,v.stateNode.isHidden=w,!w||v.alternate!==null&&v.alternate.memoizedState!==null||(bh=yt())),g&4&&B0(a);break;case 22:if(ae=h!==null&&h.memoizedState!==null,a.mode&1?(Wt=(X=Wt)||ae,Xn(c,a),Wt=X):Xn(c,a),ps(a),g&8192){if(X=a.memoizedState!==null,(a.stateNode.isHidden=X)&&!ae&&(a.mode&1)!==0)for(je=a,ae=a.child;ae!==null;){for(ce=je=ae;je!==null;){switch(ie=je,me=ie.child,ie.tag){case 0:case 11:case 14:case 15:Ba(4,ie,ie.return);break;case 1:Ei(ie,ie.return);var ke=ie.stateNode;if(typeof ke.componentWillUnmount=="function"){g=ie,h=ie.return;try{c=g,ke.props=c.memoizedProps,ke.state=c.memoizedState,ke.componentWillUnmount()}catch(be){ft(g,h,be)}}break;case 5:Ei(ie,ie.return);break;case 22:if(ie.memoizedState!==null){V0(ce);continue}}me!==null?(me.return=ie,je=me):V0(ce)}ae=ae.sibling}e:for(ae=null,ce=a;;){if(ce.tag===5){if(ae===null){ae=ce;try{v=ce.stateNode,X?(w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(O=ce.stateNode,H=ce.memoizedProps.style,T=H!=null&&H.hasOwnProperty("display")?H.display:null,O.style.display=tn("display",T))}catch(be){ft(a,a.return,be)}}}else if(ce.tag===6){if(ae===null)try{ce.stateNode.nodeValue=X?"":ce.memoizedProps}catch(be){ft(a,a.return,be)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===a)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===a)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===a)break e;ae===ce&&(ae=null),ce=ce.return}ae===ce&&(ae=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:Xn(c,a),ps(a),g&4&&B0(a);break;case 21:break;default:Xn(c,a),ps(a)}}function ps(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(O0(h)){var g=h;break e}h=h.return}throw Error(s(160))}switch(g.tag){case 5:var v=g.stateNode;g.flags&32&&(We(v,""),g.flags&=-33);var w=_0(a);jh(a,w,v);break;case 3:case 4:var T=g.stateNode.containerInfo,O=_0(a);yh(a,O,T);break;default:throw Error(s(161))}}catch(H){ft(a,a.return,H)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function O4(a,c,h){je=a,U0(a)}function U0(a,c,h){for(var g=(a.mode&1)!==0;je!==null;){var v=je,w=v.child;if(v.tag===22&&g){var T=v.memoizedState!==null||Xl;if(!T){var O=v.alternate,H=O!==null&&O.memoizedState!==null||Wt;O=Xl;var X=Wt;if(Xl=T,(Wt=H)&&!X)for(je=v;je!==null;)T=je,H=T.child,T.tag===22&&T.memoizedState!==null?K0(v):H!==null?(H.return=T,je=H):K0(v);for(;w!==null;)je=w,U0(w),w=w.sibling;je=v,Xl=O,Wt=X}H0(a)}else(v.subtreeFlags&8772)!==0&&w!==null?(w.return=v,je=w):H0(a)}}function H0(a){for(;je!==null;){var c=je;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Wt||Jl(5,c);break;case 1:var g=c.stateNode;if(c.flags&4&&!Wt)if(h===null)g.componentDidMount();else{var v=c.elementType===c.type?h.memoizedProps:Qn(c.type,h.memoizedProps);g.componentDidUpdate(v,h.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var w=c.updateQueue;w!==null&&Vg(c,w,g);break;case 3:var T=c.updateQueue;if(T!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}Vg(c,T,h)}break;case 5:var O=c.stateNode;if(h===null&&c.flags&4){h=O;var H=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&h.focus();break;case"img":H.src&&(h.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var X=c.alternate;if(X!==null){var ae=X.memoizedState;if(ae!==null){var ce=ae.dehydrated;ce!==null&&ka(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Wt||c.flags&512&&xh(c)}catch(ie){ft(c,c.return,ie)}}if(c===a){je=null;break}if(h=c.sibling,h!==null){h.return=c.return,je=h;break}je=c.return}}function V0(a){for(;je!==null;){var c=je;if(c===a){je=null;break}var h=c.sibling;if(h!==null){h.return=c.return,je=h;break}je=c.return}}function K0(a){for(;je!==null;){var c=je;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Jl(4,c)}catch(H){ft(c,h,H)}break;case 1:var g=c.stateNode;if(typeof g.componentDidMount=="function"){var v=c.return;try{g.componentDidMount()}catch(H){ft(c,v,H)}}var w=c.return;try{xh(c)}catch(H){ft(c,w,H)}break;case 5:var T=c.return;try{xh(c)}catch(H){ft(c,T,H)}}}catch(H){ft(c,c.return,H)}if(c===a){je=null;break}var O=c.sibling;if(O!==null){O.return=c.return,je=O;break}je=c.return}}var _4=Math.ceil,ec=A.ReactCurrentDispatcher,kh=A.ReactCurrentOwner,Mn=A.ReactCurrentBatchConfig,Ve=0,It=null,vt=null,Mt=0,jn=0,Ai=Js(0),Tt=0,Wa=null,Ar=0,tc=0,vh=0,Ua=null,an=null,bh=0,Pi=1/0,Rs=null,nc=!1,wh=null,ir=null,sc=!1,ar=null,rc=0,Ha=0,Nh=null,ic=-1,ac=0;function Jt(){return(Ve&6)!==0?yt():ic!==-1?ic:ic=yt()}function or(a){return(a.mode&1)===0?1:(Ve&2)!==0&&Mt!==0?Mt&-Mt:w4.transition!==null?(ac===0&&(ac=_1()),ac):(a=Xe,a!==0||(a=window.event,a=a===void 0?16:G1(a.type)),a)}function Jn(a,c,h,g){if(50<Ha)throw Ha=0,Nh=null,Error(s(185));ma(a,h,g),((Ve&2)===0||a!==It)&&(a===It&&((Ve&2)===0&&(tc|=h),Tt===4&&lr(a,Mt)),on(a,g),h===1&&Ve===0&&(c.mode&1)===0&&(Pi=yt()+500,Fl&&tr()))}function on(a,c){var h=a.callbackNode;w3(a,c);var g=ml(a,a===It?Mt:0);if(g===0)h!==null&&M1(h),a.callbackNode=null,a.callbackPriority=0;else if(c=g&-g,a.callbackPriority!==c){if(h!=null&&M1(h),c===1)a.tag===0?b4(G0.bind(null,a)):Fg(G0.bind(null,a)),y4(function(){(Ve&6)===0&&tr()}),h=null;else{switch(D1(g)){case 1:h=sd;break;case 4:h=q1;break;case 16:h=dl;break;case 536870912:h=O1;break;default:h=dl}h=sx(h,Y0.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function Y0(a,c){if(ic=-1,ac=0,(Ve&6)!==0)throw Error(s(327));var h=a.callbackNode;if(Ri()&&a.callbackNode!==h)return null;var g=ml(a,a===It?Mt:0);if(g===0)return null;if((g&30)!==0||(g&a.expiredLanes)!==0||c)c=oc(a,g);else{c=g;var v=Ve;Ve|=2;var w=Z0();(It!==a||Mt!==c)&&(Rs=null,Pi=yt()+500,Rr(a,c));do try{W4();break}catch(O){Q0(a,O)}while(!0);Bd(),ec.current=w,Ve=v,vt!==null?c=0:(It=null,Mt=0,c=Tt)}if(c!==0){if(c===2&&(v=rd(a),v!==0&&(g=v,c=Sh(a,v))),c===1)throw h=Wa,Rr(a,0),lr(a,g),on(a,yt()),h;if(c===6)lr(a,g);else{if(v=a.current.alternate,(g&30)===0&&!D4(v)&&(c=oc(a,g),c===2&&(w=rd(a),w!==0&&(g=w,c=Sh(a,w))),c===1))throw h=Wa,Rr(a,0),lr(a,g),on(a,yt()),h;switch(a.finishedWork=v,a.finishedLanes=g,c){case 0:case 1:throw Error(s(345));case 2:Ir(a,an,Rs);break;case 3:if(lr(a,g),(g&130023424)===g&&(c=bh+500-yt(),10<c)){if(ml(a,0)!==0)break;if(v=a.suspendedLanes,(v&g)!==g){Jt(),a.pingedLanes|=a.suspendedLanes&v;break}a.timeoutHandle=Pd(Ir.bind(null,a,an,Rs),c);break}Ir(a,an,Rs);break;case 4:if(lr(a,g),(g&4194240)===g)break;for(c=a.eventTimes,v=-1;0<g;){var T=31-Kn(g);w=1<<T,T=c[T],T>v&&(v=T),g&=~w}if(g=v,g=yt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*_4(g/1960))-g,10<g){a.timeoutHandle=Pd(Ir.bind(null,a,an,Rs),g);break}Ir(a,an,Rs);break;case 5:Ir(a,an,Rs);break;default:throw Error(s(329))}}}return on(a,yt()),a.callbackNode===h?Y0.bind(null,a):null}function Sh(a,c){var h=Ua;return a.current.memoizedState.isDehydrated&&(Rr(a,c).flags|=256),a=oc(a,c),a!==2&&(c=an,an=h,c!==null&&Ch(c)),a}function Ch(a){an===null?an=a:an.push.apply(an,a)}function D4(a){for(var c=a;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var g=0;g<h.length;g++){var v=h[g],w=v.getSnapshot;v=v.value;try{if(!Yn(w(),v))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function lr(a,c){for(c&=~vh,c&=~tc,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-Kn(c),g=1<<h;a[h]=-1,c&=~g}}function G0(a){if((Ve&6)!==0)throw Error(s(327));Ri();var c=ml(a,0);if((c&1)===0)return on(a,yt()),null;var h=oc(a,c);if(a.tag!==0&&h===2){var g=rd(a);g!==0&&(c=g,h=Sh(a,g))}if(h===1)throw h=Wa,Rr(a,0),lr(a,c),on(a,yt()),h;if(h===6)throw Error(s(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Ir(a,an,Rs),on(a,yt()),null}function $h(a,c){var h=Ve;Ve|=1;try{return a(c)}finally{Ve=h,Ve===0&&(Pi=yt()+500,Fl&&tr())}}function Pr(a){ar!==null&&ar.tag===0&&(Ve&6)===0&&Ri();var c=Ve;Ve|=1;var h=Mn.transition,g=Xe;try{if(Mn.transition=null,Xe=1,a)return a()}finally{Xe=g,Mn.transition=h,Ve=c,(Ve&6)===0&&tr()}}function Th(){jn=Ai.current,it(Ai)}function Rr(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,x4(h)),vt!==null)for(h=vt.return;h!==null;){var g=h;switch(Md(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Rl();break;case 3:$i(),it(nn),it(_t),Qd();break;case 5:Yd(g);break;case 4:$i();break;case 13:it(ut);break;case 19:it(ut);break;case 10:Wd(g.type._context);break;case 22:case 23:Th()}h=h.return}if(It=a,vt=a=cr(a.current,null),Mt=jn=c,Tt=0,Wa=null,vh=tc=Ar=0,an=Ua=null,$r!==null){for(c=0;c<$r.length;c++)if(h=$r[c],g=h.interleaved,g!==null){h.interleaved=null;var v=g.next,w=h.pending;if(w!==null){var T=w.next;w.next=v,g.next=T}h.pending=g}$r=null}return a}function Q0(a,c){do{var h=vt;try{if(Bd(),Ul.current=Yl,Hl){for(var g=dt.memoizedState;g!==null;){var v=g.queue;v!==null&&(v.pending=null),g=g.next}Hl=!1}if(Er=0,Rt=$t=dt=null,Ma=!1,qa=0,kh.current=null,h===null||h.return===null){Tt=1,Wa=c,vt=null;break}e:{var w=a,T=h.return,O=h,H=c;if(c=Mt,O.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var X=H,ae=O,ce=ae.tag;if((ae.mode&1)===0&&(ce===0||ce===11||ce===15)){var ie=ae.alternate;ie?(ae.updateQueue=ie.updateQueue,ae.memoizedState=ie.memoizedState,ae.lanes=ie.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var me=v0(T);if(me!==null){me.flags&=-257,b0(me,T,O,w,c),me.mode&1&&k0(w,X,c),c=me,H=X;var ke=c.updateQueue;if(ke===null){var be=new Set;be.add(H),c.updateQueue=be}else ke.add(H);break e}else{if((c&1)===0){k0(w,X,c),Eh();break e}H=Error(s(426))}}else if(ot&&O.mode&1){var jt=v0(T);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),b0(jt,T,O,w,c),_d(Ti(H,O));break e}}w=H=Ti(H,O),Tt!==4&&(Tt=2),Ua===null?Ua=[w]:Ua.push(w),w=T;do{switch(w.tag){case 3:w.flags|=65536,c&=-c,w.lanes|=c;var Q=y0(w,H,c);Hg(w,Q);break e;case 1:O=H;var K=w.type,Z=w.stateNode;if((w.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(ir===null||!ir.has(Z)))){w.flags|=65536,c&=-c,w.lanes|=c;var he=j0(w,O,c);Hg(w,he);break e}}w=w.return}while(w!==null)}J0(h)}catch(we){c=we,vt===h&&h!==null&&(vt=h=h.return);continue}break}while(!0)}function Z0(){var a=ec.current;return ec.current=Yl,a===null?Yl:a}function Eh(){(Tt===0||Tt===3||Tt===2)&&(Tt=4),It===null||(Ar&268435455)===0&&(tc&268435455)===0||lr(It,Mt)}function oc(a,c){var h=Ve;Ve|=2;var g=Z0();(It!==a||Mt!==c)&&(Rs=null,Rr(a,c));do try{B4();break}catch(v){Q0(a,v)}while(!0);if(Bd(),Ve=h,ec.current=g,vt!==null)throw Error(s(261));return It=null,Mt=0,Tt}function B4(){for(;vt!==null;)X0(vt)}function W4(){for(;vt!==null&&!f3();)X0(vt)}function X0(a){var c=nx(a.alternate,a,jn);a.memoizedProps=a.pendingProps,c===null?J0(a):vt=c,kh.current=null}function J0(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=z4(h,c,jn),h!==null){vt=h;return}}else{if(h=L4(h,c),h!==null){h.flags&=32767,vt=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Tt=6,vt=null;return}}if(c=c.sibling,c!==null){vt=c;return}vt=c=a}while(c!==null);Tt===0&&(Tt=5)}function Ir(a,c,h){var g=Xe,v=Mn.transition;try{Mn.transition=null,Xe=1,U4(a,c,h,g)}finally{Mn.transition=v,Xe=g}return null}function U4(a,c,h,g){do Ri();while(ar!==null);if((Ve&6)!==0)throw Error(s(327));h=a.finishedWork;var v=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(s(177));a.callbackNode=null,a.callbackPriority=0;var w=h.lanes|h.childLanes;if(N3(a,w),a===It&&(vt=It=null,Mt=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||sc||(sc=!0,sx(dl,function(){return Ri(),null})),w=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||w){w=Mn.transition,Mn.transition=null;var T=Xe;Xe=1;var O=Ve;Ve|=4,kh.current=null,q4(a,h),W0(h,a),u4(Ed),yl=!!Td,Ed=Td=null,a.current=h,O4(h),m3(),Ve=O,Xe=T,Mn.transition=w}else a.current=h;if(sc&&(sc=!1,ar=a,rc=v),w=a.pendingLanes,w===0&&(ir=null),y3(h.stateNode),on(a,yt()),c!==null)for(g=a.onRecoverableError,h=0;h<c.length;h++)v=c[h],g(v.value,{componentStack:v.stack,digest:v.digest});if(nc)throw nc=!1,a=wh,wh=null,a;return(rc&1)!==0&&a.tag!==0&&Ri(),w=a.pendingLanes,(w&1)!==0?a===Nh?Ha++:(Ha=0,Nh=a):Ha=0,tr(),null}function Ri(){if(ar!==null){var a=D1(rc),c=Mn.transition,h=Xe;try{if(Mn.transition=null,Xe=16>a?16:a,ar===null)var g=!1;else{if(a=ar,ar=null,rc=0,(Ve&6)!==0)throw Error(s(331));var v=Ve;for(Ve|=4,je=a.current;je!==null;){var w=je,T=w.child;if((je.flags&16)!==0){var O=w.deletions;if(O!==null){for(var H=0;H<O.length;H++){var X=O[H];for(je=X;je!==null;){var ae=je;switch(ae.tag){case 0:case 11:case 15:Ba(8,ae,w)}var ce=ae.child;if(ce!==null)ce.return=ae,je=ce;else for(;je!==null;){ae=je;var ie=ae.sibling,me=ae.return;if(q0(ae),ae===X){je=null;break}if(ie!==null){ie.return=me,je=ie;break}je=me}}}var ke=w.alternate;if(ke!==null){var be=ke.child;if(be!==null){ke.child=null;do{var jt=be.sibling;be.sibling=null,be=jt}while(be!==null)}}je=w}}if((w.subtreeFlags&2064)!==0&&T!==null)T.return=w,je=T;else e:for(;je!==null;){if(w=je,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:Ba(9,w,w.return)}var Q=w.sibling;if(Q!==null){Q.return=w.return,je=Q;break e}je=w.return}}var K=a.current;for(je=K;je!==null;){T=je;var Z=T.child;if((T.subtreeFlags&2064)!==0&&Z!==null)Z.return=T,je=Z;else e:for(T=K;je!==null;){if(O=je,(O.flags&2048)!==0)try{switch(O.tag){case 0:case 11:case 15:Jl(9,O)}}catch(we){ft(O,O.return,we)}if(O===T){je=null;break e}var he=O.sibling;if(he!==null){he.return=O.return,je=he;break e}je=O.return}}if(Ve=v,tr(),cs&&typeof cs.onPostCommitFiberRoot=="function")try{cs.onPostCommitFiberRoot(hl,a)}catch{}g=!0}return g}finally{Xe=h,Mn.transition=c}}return!1}function ex(a,c,h){c=Ti(h,c),c=y0(a,c,1),a=sr(a,c,1),c=Jt(),a!==null&&(ma(a,1,c),on(a,c))}function ft(a,c,h){if(a.tag===3)ex(a,a,h);else for(;c!==null;){if(c.tag===3){ex(c,a,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ir===null||!ir.has(g))){a=Ti(h,a),a=j0(c,a,1),c=sr(c,a,1),a=Jt(),c!==null&&(ma(c,1,a),on(c,a));break}}c=c.return}}function H4(a,c,h){var g=a.pingCache;g!==null&&g.delete(c),c=Jt(),a.pingedLanes|=a.suspendedLanes&h,It===a&&(Mt&h)===h&&(Tt===4||Tt===3&&(Mt&130023424)===Mt&&500>yt()-bh?Rr(a,0):vh|=h),on(a,c)}function tx(a,c){c===0&&((a.mode&1)===0?c=1:(c=fl,fl<<=1,(fl&130023424)===0&&(fl=4194304)));var h=Jt();a=Es(a,c),a!==null&&(ma(a,c,h),on(a,h))}function V4(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),tx(a,h)}function K4(a,c){var h=0;switch(a.tag){case 13:var g=a.stateNode,v=a.memoizedState;v!==null&&(h=v.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(s(314))}g!==null&&g.delete(c),tx(a,h)}var nx;nx=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||nn.current)rn=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return rn=!1,F4(a,c,h);rn=(a.flags&131072)!==0}else rn=!1,ot&&(c.flags&1048576)!==0&&zg(c,Ll,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;Zl(a,c),a=c.pendingProps;var v=ki(c,_t.current);Ci(c,h),v=Jd(null,c,g,a,v,h);var w=eh();return c.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,sn(g)?(w=!0,Il(c)):w=!1,c.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,Vd(c),v.updater=Gl,c.stateNode=v,v._reactInternals=c,ah(c,g,a,h),c=uh(null,c,g,!0,w,h)):(c.tag=0,ot&&w&&Ld(c),Xt(null,c,v,h),c=c.child),c;case 16:g=c.elementType;e:{switch(Zl(a,c),a=c.pendingProps,v=g._init,g=v(g._payload),c.type=g,v=c.tag=G4(g),a=Qn(g,a),v){case 0:c=ch(null,c,g,a,h);break e;case 1:c=T0(null,c,g,a,h);break e;case 11:c=w0(null,c,g,a,h);break e;case 14:c=N0(null,c,g,Qn(g.type,a),h);break e}throw Error(s(306,g,""))}return c;case 0:return g=c.type,v=c.pendingProps,v=c.elementType===g?v:Qn(g,v),ch(a,c,g,v,h);case 1:return g=c.type,v=c.pendingProps,v=c.elementType===g?v:Qn(g,v),T0(a,c,g,v,h);case 3:e:{if(E0(c),a===null)throw Error(s(387));g=c.pendingProps,w=c.memoizedState,v=w.element,Ug(a,c),Bl(c,g,null,h);var T=c.memoizedState;if(g=T.element,w.isDehydrated)if(w={element:g,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},c.updateQueue.baseState=w,c.memoizedState=w,c.flags&256){v=Ti(Error(s(423)),c),c=A0(a,c,g,h,v);break e}else if(g!==v){v=Ti(Error(s(424)),c),c=A0(a,c,g,h,v);break e}else for(yn=Xs(c.stateNode.containerInfo.firstChild),xn=c,ot=!0,Gn=null,h=Bg(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(wi(),g===v){c=Ps(a,c,h);break e}Xt(a,c,g,h)}c=c.child}return c;case 5:return Kg(c),a===null&&Od(c),g=c.type,v=c.pendingProps,w=a!==null?a.memoizedProps:null,T=v.children,Ad(g,v)?T=null:w!==null&&Ad(g,w)&&(c.flags|=32),$0(a,c),Xt(a,c,T,h),c.child;case 6:return a===null&&Od(c),null;case 13:return P0(a,c,h);case 4:return Kd(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=Ni(c,null,g,h):Xt(a,c,g,h),c.child;case 11:return g=c.type,v=c.pendingProps,v=c.elementType===g?v:Qn(g,v),w0(a,c,g,v,h);case 7:return Xt(a,c,c.pendingProps,h),c.child;case 8:return Xt(a,c,c.pendingProps.children,h),c.child;case 12:return Xt(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(g=c.type._context,v=c.pendingProps,w=c.memoizedProps,T=v.value,tt(Ol,g._currentValue),g._currentValue=T,w!==null)if(Yn(w.value,T)){if(w.children===v.children&&!nn.current){c=Ps(a,c,h);break e}}else for(w=c.child,w!==null&&(w.return=c);w!==null;){var O=w.dependencies;if(O!==null){T=w.child;for(var H=O.firstContext;H!==null;){if(H.context===g){if(w.tag===1){H=As(-1,h&-h),H.tag=2;var X=w.updateQueue;if(X!==null){X=X.shared;var ae=X.pending;ae===null?H.next=H:(H.next=ae.next,ae.next=H),X.pending=H}}w.lanes|=h,H=w.alternate,H!==null&&(H.lanes|=h),Ud(w.return,h,c),O.lanes|=h;break}H=H.next}}else if(w.tag===10)T=w.type===c.type?null:w.child;else if(w.tag===18){if(T=w.return,T===null)throw Error(s(341));T.lanes|=h,O=T.alternate,O!==null&&(O.lanes|=h),Ud(T,h,c),T=w.sibling}else T=w.child;if(T!==null)T.return=w;else for(T=w;T!==null;){if(T===c){T=null;break}if(w=T.sibling,w!==null){w.return=T.return,T=w;break}T=T.return}w=T}Xt(a,c,v.children,h),c=c.child}return c;case 9:return v=c.type,g=c.pendingProps.children,Ci(c,h),v=zn(v),g=g(v),c.flags|=1,Xt(a,c,g,h),c.child;case 14:return g=c.type,v=Qn(g,c.pendingProps),v=Qn(g.type,v),N0(a,c,g,v,h);case 15:return S0(a,c,c.type,c.pendingProps,h);case 17:return g=c.type,v=c.pendingProps,v=c.elementType===g?v:Qn(g,v),Zl(a,c),c.tag=1,sn(g)?(a=!0,Il(c)):a=!1,Ci(c,h),g0(c,g,v),ah(c,g,v,h),uh(null,c,g,!0,a,h);case 19:return I0(a,c,h);case 22:return C0(a,c,h)}throw Error(s(156,c.tag))};function sx(a,c){return L1(a,c)}function Y4(a,c,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(a,c,h,g){return new Y4(a,c,h,g)}function Ah(a){return a=a.prototype,!(!a||!a.isReactComponent)}function G4(a){if(typeof a=="function")return Ah(a)?1:0;if(a!=null){if(a=a.$$typeof,a===L)return 11;if(a===G)return 14}return 2}function cr(a,c){var h=a.alternate;return h===null?(h=qn(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function lc(a,c,h,g,v,w){var T=2;if(g=a,typeof a=="function")Ah(a)&&(T=1);else if(typeof a=="string")T=5;else e:switch(a){case M:return Fr(h.children,v,w,c);case F:T=8,v|=8;break;case W:return a=qn(12,h,c,v|2),a.elementType=W,a.lanes=w,a;case U:return a=qn(13,h,c,v),a.elementType=U,a.lanes=w,a;case _:return a=qn(19,h,c,v),a.elementType=_,a.lanes=w,a;case V:return cc(h,v,w,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case I:T=10;break e;case q:T=9;break e;case L:T=11;break e;case G:T=14;break e;case le:T=16,g=null;break e}throw Error(s(130,a==null?a:typeof a,""))}return c=qn(T,h,c,v),c.elementType=a,c.type=g,c.lanes=w,c}function Fr(a,c,h,g){return a=qn(7,a,g,c),a.lanes=h,a}function cc(a,c,h,g){return a=qn(22,a,g,c),a.elementType=V,a.lanes=h,a.stateNode={isHidden:!1},a}function Ph(a,c,h){return a=qn(6,a,null,c),a.lanes=h,a}function Rh(a,c,h){return c=qn(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function Q4(a,c,h,g,v){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=id(0),this.expirationTimes=id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=id(0),this.identifierPrefix=g,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Ih(a,c,h,g,v,w,T,O,H){return a=new Q4(a,c,h,O,H),c===1?(c=1,w===!0&&(c|=8)):c=0,w=qn(3,null,null,c),a.current=w,w.stateNode=a,w.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vd(w),a}function Z4(a,c,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:g==null?null:""+g,children:a,containerInfo:c,implementation:h}}function rx(a){if(!a)return er;a=a._reactInternals;e:{if(br(a)!==a||a.tag!==1)throw Error(s(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(sn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(s(171))}if(a.tag===1){var h=a.type;if(sn(h))return Rg(a,h,c)}return c}function ix(a,c,h,g,v,w,T,O,H){return a=Ih(h,g,!0,a,v,w,T,O,H),a.context=rx(null),h=a.current,g=Jt(),v=or(h),w=As(g,v),w.callback=c??null,sr(h,w,v),a.current.lanes=v,ma(a,v,g),on(a,g),a}function uc(a,c,h,g){var v=c.current,w=Jt(),T=or(v);return h=rx(h),c.context===null?c.context=h:c.pendingContext=h,c=As(w,T),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=sr(v,c,T),a!==null&&(Jn(a,v,T,w),Dl(a,v,T)),T}function dc(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function ax(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function Fh(a,c){ax(a,c),(a=a.alternate)&&ax(a,c)}function X4(){return null}var ox=typeof reportError=="function"?reportError:function(a){console.error(a)};function zh(a){this._internalRoot=a}hc.prototype.render=zh.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(s(409));uc(a,c,null,null)},hc.prototype.unmount=zh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Pr(function(){uc(null,a,null,null)}),c[Ss]=null}};function hc(a){this._internalRoot=a}hc.prototype.unstable_scheduleHydration=function(a){if(a){var c=U1();a={blockedOn:null,target:a,priority:c};for(var h=0;h<Gs.length&&c!==0&&c<Gs[h].priority;h++);Gs.splice(h,0,a),h===0&&K1(a)}};function Lh(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function pc(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function lx(){}function J4(a,c,h,g,v){if(v){if(typeof g=="function"){var w=g;g=function(){var X=dc(T);w.call(X)}}var T=ix(c,g,a,0,null,!1,!1,"",lx);return a._reactRootContainer=T,a[Ss]=T.current,Ea(a.nodeType===8?a.parentNode:a),Pr(),T}for(;v=a.lastChild;)a.removeChild(v);if(typeof g=="function"){var O=g;g=function(){var X=dc(H);O.call(X)}}var H=Ih(a,0,!1,null,null,!1,!1,"",lx);return a._reactRootContainer=H,a[Ss]=H.current,Ea(a.nodeType===8?a.parentNode:a),Pr(function(){uc(c,H,h,g)}),H}function fc(a,c,h,g,v){var w=h._reactRootContainer;if(w){var T=w;if(typeof v=="function"){var O=v;v=function(){var H=dc(T);O.call(H)}}uc(c,T,a,v)}else T=J4(h,c,a,v,g);return dc(T)}B1=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=fa(c.pendingLanes);h!==0&&(ad(c,h|1),on(c,yt()),(Ve&6)===0&&(Pi=yt()+500,tr()))}break;case 13:Pr(function(){var g=Es(a,1);if(g!==null){var v=Jt();Jn(g,a,1,v)}}),Fh(a,1)}},od=function(a){if(a.tag===13){var c=Es(a,134217728);if(c!==null){var h=Jt();Jn(c,a,134217728,h)}Fh(a,134217728)}},W1=function(a){if(a.tag===13){var c=or(a),h=Es(a,c);if(h!==null){var g=Jt();Jn(h,a,c,g)}Fh(a,c)}},U1=function(){return Xe},H1=function(a,c){var h=Xe;try{return Xe=a,c()}finally{Xe=h}},Ju=function(a,c,h){switch(c){case"input":if(Vn(a,h),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==a&&g.form===a.form){var v=Pl(g);if(!v)throw Error(s(90));$n(g),Vn(g,v)}}}break;case"textarea":ls(a,h);break;case"select":c=h.value,c!=null&&An(a,!!h.multiple,c,!1)}},E1=$h,A1=Pr;var e5={usingClientEntryPoint:!1,Events:[Ra,yi,Pl,$1,T1,$h]},Va={findFiberByHostInstance:wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t5={bundleType:Va.bundleType,version:Va.version,rendererPackageName:Va.rendererPackageName,rendererConfig:Va.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=F1(a),a===null?null:a.stateNode},findFiberByHostInstance:Va.findFiberByHostInstance||X4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mc.isDisabled&&mc.supportsFiber)try{hl=mc.inject(t5),cs=mc}catch{}}return ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e5,ln.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lh(c))throw Error(s(200));return Z4(a,c,null,h)},ln.createRoot=function(a,c){if(!Lh(a))throw Error(s(299));var h=!1,g="",v=ox;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onRecoverableError!==void 0&&(v=c.onRecoverableError)),c=Ih(a,1,!1,null,null,h,!1,g,v),a[Ss]=c.current,Ea(a.nodeType===8?a.parentNode:a),new zh(c)},ln.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return a=F1(c),a=a===null?null:a.stateNode,a},ln.flushSync=function(a){return Pr(a)},ln.hydrate=function(a,c,h){if(!pc(c))throw Error(s(200));return fc(null,a,c,!0,h)},ln.hydrateRoot=function(a,c,h){if(!Lh(a))throw Error(s(405));var g=h!=null&&h.hydratedSources||null,v=!1,w="",T=ox;if(h!=null&&(h.unstable_strictMode===!0&&(v=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onRecoverableError!==void 0&&(T=h.onRecoverableError)),c=ix(c,null,a,1,h??null,v,!1,w,T),a[Ss]=c.current,Ea(a),g)for(a=0;a<g.length;a++)h=g[a],v=h._getVersion,v=v(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,v]:c.mutableSourceEagerHydrationData.push(h,v);return new hc(c)},ln.render=function(a,c,h){if(!pc(c))throw Error(s(200));return fc(null,a,c,!1,h)},ln.unmountComponentAtNode=function(a){if(!pc(a))throw Error(s(40));return a._reactRootContainer?(Pr(function(){fc(null,null,a,!1,function(){a._reactRootContainer=null,a[Ss]=null})}),!0):!1},ln.unstable_batchedUpdates=$h,ln.unstable_renderSubtreeIntoContainer=function(a,c,h,g){if(!pc(h))throw Error(s(200));if(a==null||a._reactInternals===void 0)throw Error(s(38));return fc(a,c,h,!1,g)},ln.version="18.3.1-next-f1338f8080-20240426",ln}var gx;function cj(){if(gx)return Oh.exports;gx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Oh.exports=l5(),Oh.exports}var xx;function c5(){if(xx)return gc;xx=1;var e=cj();return gc.createRoot=e.createRoot,gc.hydrateRoot=e.hydrateRoot,gc}var u5=c5(),Xr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},d5=class extends Xr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Of=new d5,h5={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},p5=class{#t=h5;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,n){return this.#t.setTimeout(e,n)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,n){return this.#t.setInterval(e,n)}clearInterval(e){this.#t.clearInterval(e)}},Mr=new p5;function f5(e){setTimeout(e,0)}var m5=typeof window>"u"||"Deno"in globalThis;function Ut(){}function g5(e,n){return typeof e=="function"?e(n):e}function Mp(e){return typeof e=="number"&&e>=0&&e!==1/0}function uj(e,n){return Math.max(e+(n||0)-Date.now(),0)}function xr(e,n){return typeof e=="function"?e(n):e}function bn(e,n){return typeof e=="function"?e(n):e}function yx(e,n){const{type:s="all",exact:r,fetchStatus:i,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(n.queryHash!==_f(l,n.options))return!1}else if(!fo(n.queryKey,l))return!1}if(s!=="all"){const d=n.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof u=="boolean"&&n.isStale()!==u||i&&i!==n.state.fetchStatus||o&&!o(n))}function jx(e,n){const{exact:s,status:r,predicate:i,mutationKey:o}=e;if(o){if(!n.options.mutationKey)return!1;if(s){if(Hr(n.options.mutationKey)!==Hr(o))return!1}else if(!fo(n.options.mutationKey,o))return!1}return!(r&&n.state.status!==r||i&&!i(n))}function _f(e,n){return(n?.queryKeyHashFn||Hr)(e)}function Hr(e){return JSON.stringify(e,(n,s)=>qp(s)?Object.keys(s).sort().reduce((r,i)=>(r[i]=s[i],r),{}):s)}function fo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(s=>fo(e[s],n[s])):!1}var x5=Object.prototype.hasOwnProperty;function Df(e,n,s=0){if(e===n)return e;if(s>500)return n;const r=kx(e)&&kx(n);if(!r&&!(qp(e)&&qp(n)))return n;const o=(r?e:Object.keys(e)).length,l=r?n:Object.keys(n),u=l.length,d=r?new Array(u):{};let p=0;for(let f=0;f<u;f++){const m=r?f:l[f],x=e[m],y=n[m];if(x===y){d[m]=x,(r?f<o:x5.call(e,m))&&p++;continue}if(x===null||y===null||typeof x!="object"||typeof y!="object"){d[m]=y;continue}const j=Df(x,y,s+1);d[m]=j,j===x&&p++}return o===u&&p===o?e:d}function mo(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const s in e)if(e[s]!==n[s])return!1;return!0}function kx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qp(e){if(!vx(e))return!1;const n=e.constructor;if(n===void 0)return!0;const s=n.prototype;return!(!vx(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vx(e){return Object.prototype.toString.call(e)==="[object Object]"}function y5(e){return new Promise(n=>{Mr.setTimeout(n,e)})}function Op(e,n,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,n):s.structuralSharing!==!1?Df(e,n):n}function j5(e){return e}function k5(e,n,s=0){const r=[...e,n];return s&&r.length>s?r.slice(1):r}function v5(e,n,s=0){const r=[n,...e];return s&&r.length>s?r.slice(0,-1):r}var Bf=Symbol();function dj(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===Bf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wf(e,n){return typeof e=="function"?e(...n):!!e}function b5(e,n,s){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=n(),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var go=(()=>{let e=()=>m5;return{isServer(){return e()},setIsServer(n){e=n}}})();function _p(){let e,n;const s=new Promise((i,o)=>{e=i,n=o});s.status="pending",s.catch(()=>{});function r(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},s.reject=i=>{r({status:"rejected",reason:i}),n(i)},s}var w5=f5;function N5(){let e=[],n=0,s=u=>{u()},r=u=>{u()},i=w5;const o=u=>{n?e.push(u):i(()=>{s(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{s(d)})})})};return{batch:u=>{let d;n++;try{d=u()}finally{n--,n||l()}return d},batchCalls:u=>(...d)=>{o(()=>{u(...d)})},schedule:o,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var mt=N5(),S5=class extends Xr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},Uc=new S5;function C5(e){return Math.min(1e3*2**e,3e4)}function hj(e){return(e??"online")==="online"?Uc.isOnline():!0}var Dp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function pj(e){let n=!1,s=0,r;const i=_p(),o=()=>i.status!=="pending",l=k=>{if(!o()){const b=new Dp(k);x(b),e.onCancel?.(b)}},u=()=>{n=!0},d=()=>{n=!1},p=()=>Of.isFocused()&&(e.networkMode==="always"||Uc.isOnline())&&e.canRun(),f=()=>hj(e.networkMode)&&e.canRun(),m=k=>{o()||(r?.(),i.resolve(k))},x=k=>{o()||(r?.(),i.reject(k))},y=()=>new Promise(k=>{r=b=>{(o()||p())&&k(b)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),j=()=>{if(o())return;let k;const b=s===0?e.initialPromise:void 0;try{k=b??e.fn()}catch(S){k=Promise.reject(S)}Promise.resolve(k).then(m).catch(S=>{if(o())return;const N=e.retry??(go.isServer()?0:3),$=e.retryDelay??C5,A=typeof $=="function"?$(s,S):$,R=N===!0||typeof N=="number"&&s<N||typeof N=="function"&&N(s,S);if(n||!R){x(S);return}s++,e.onFail?.(s,S),y5(A).then(()=>p()?void 0:y()).then(()=>{n?x(S):j()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:f,start:()=>(f()?j():y().then(j),i)}}var fj=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mp(this.gcTime)&&(this.#t=Mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(go.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Mr.clearTimeout(this.#t),this.#t=void 0)}};function $5(e){return{onFetch:(n,s)=>{const r=n.options,i=n.fetchOptions?.meta?.fetchMore?.direction,o=n.state.data?.pages||[],l=n.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const p=async()=>{let f=!1;const m=j=>{b5(j,()=>n.signal,()=>f=!0)},x=dj(n.options,n.fetchOptions),y=async(j,k,b)=>{if(f)return Promise.reject(n.signal.reason);if(k==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const E={client:n.client,queryKey:n.queryKey,pageParam:k,direction:b?"backward":"forward",meta:n.options.meta};return m(E),E})(),$=await x(N),{maxPages:A}=n.options,R=b?v5:k5;return{pages:R(j.pages,$,A),pageParams:R(j.pageParams,k,A)}};if(i&&o.length){const j=i==="backward",k=j?T5:bx,b={pages:o,pageParams:l},S=k(r,b);u=await y(b,S,j)}else{const j=e??o.length;do{const k=d===0?l[0]??r.initialPageParam:bx(r,u);if(d>0&&k==null)break;u=await y(u,k),d++}while(d<j)}return u};n.options.persister?n.fetchFn=()=>n.options.persister?.(p,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s):n.fetchFn=p}}}function bx(e,{pages:n,pageParams:s}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,s[r],s):void 0}function T5(e,{pages:n,pageParams:s}){return n.length>0?e.getPreviousPageParam?.(n[0],n,s[0],s):void 0}var E5=class extends fj{#t;#e;#n;#s;#r;#i;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#s=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Nx(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#t=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Nx(this.options);n.data!==void 0&&(this.setState(wx(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,n){const s=Op(this.state.data,e,this.options);return this.#l({data:s,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),s}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#i?.promise;return this.#i?.cancel(e),n?n.then(Ut).catch(Ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>bn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>xr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!uj(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#i&&(this.#a||this.#u()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}const s=new AbortController,r=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},i=()=>{const d=dj(this.options,n),f=(()=>{const m={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#a=!1,this.options.persister?this.options.persister(d,f,this):d(f)},l=(()=>{const d={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(d),d})();(this.#t==="infinite"?$5(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#l({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=pj({initialPromise:n?.initialPromise,fn:l.fetchFn,onCancel:d=>{d instanceof Dp&&d.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(d,p)=>{this.#l({type:"failed",failureCount:d,error:p})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const d=await this.#i.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#s.config.onSuccess?.(d,this),this.#s.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof Dp){if(d.silent)return this.#i.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#s.config.onError?.(d,this),this.#s.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...mj(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...wx(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),mt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function mj(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hj(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wx(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Nx(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,s=n!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Uf=class extends Xr{constructor(e,n){super(),this.options=n,this.#t=e,this.#a=null,this.#o=_p(),this.bindMethods(),this.setOptions(n)}#t;#e=void 0;#n=void 0;#s=void 0;#r;#i;#o;#a;#u;#l;#p;#d;#f;#c;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Sx(this.#e,this.options)?this.#h():this.updateResult(),this.#j())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bp(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bp(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#k(),this.#v(),this.#e.removeObserver(this)}setOptions(e){const n=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#e.setOptions(this.options),n._defaulted&&!mo(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Cx(this.#e,s,this.options,n)&&this.#h(),this.updateResult(),r&&(this.#e!==s||bn(this.options.enabled,this.#e)!==bn(n.enabled,this.#e)||xr(this.options.staleTime,this.#e)!==xr(n.staleTime,this.#e))&&this.#g();const i=this.#x();r&&(this.#e!==s||bn(this.options.enabled,this.#e)!==bn(n.enabled,this.#e)||i!==this.#c)&&this.#y(i)}getOptimisticResult(e){const n=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(n,e);return P5(this,s)&&(this.#s=s,this.#i=this.options,this.#r=this.#e.state),s}getCurrentResult(){return this.#s}trackResult(e,n){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),n?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(e){this.#b();let n=this.#e.fetch(this.options,e);return e?.throwOnError||(n=n.catch(Ut)),n}#g(){this.#k();const e=xr(this.options.staleTime,this.#e);if(go.isServer()||this.#s.isStale||!Mp(e))return;const s=uj(this.#s.dataUpdatedAt,e)+1;this.#d=Mr.setTimeout(()=>{this.#s.isStale||this.updateResult()},s)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#v(),this.#c=e,!(go.isServer()||bn(this.options.enabled,this.#e)===!1||!Mp(this.#c)||this.#c===0)&&(this.#f=Mr.setInterval(()=>{(this.options.refetchIntervalInBackground||Of.isFocused())&&this.#h()},this.#c))}#j(){this.#g(),this.#y(this.#x())}#k(){this.#d!==void 0&&(Mr.clearTimeout(this.#d),this.#d=void 0)}#v(){this.#f!==void 0&&(Mr.clearInterval(this.#f),this.#f=void 0)}createResult(e,n){const s=this.#e,r=this.options,i=this.#s,o=this.#r,l=this.#i,d=e!==s?e.state:this.#n,{state:p}=e;let f={...p},m=!1,x;if(n._optimisticResults){const F=this.hasListeners(),W=!F&&Sx(e,n),I=F&&Cx(e,s,n,r);(W||I)&&(f={...f,...mj(p.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:j,status:k}=f;x=f.data;let b=!1;if(n.placeholderData!==void 0&&x===void 0&&k==="pending"){let F;i?.isPlaceholderData&&n.placeholderData===l?.placeholderData?(F=i.data,b=!0):F=typeof n.placeholderData=="function"?n.placeholderData(this.#p?.state.data,this.#p):n.placeholderData,F!==void 0&&(k="success",x=Op(i?.data,F,n),m=!0)}if(n.select&&x!==void 0&&!b)if(i&&x===o?.data&&n.select===this.#u)x=this.#l;else try{this.#u=n.select,x=n.select(x),x=Op(i?.data,x,n),this.#l=x,this.#a=null}catch(F){this.#a=F}this.#a&&(y=this.#a,x=this.#l,j=Date.now(),k="error");const S=f.fetchStatus==="fetching",N=k==="pending",$=k==="error",A=N&&S,R=x!==void 0,M={status:k,fetchStatus:f.fetchStatus,isPending:N,isSuccess:k==="success",isError:$,isInitialLoading:A,isLoading:A,data:x,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:j,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!N,isLoadingError:$&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:$&&R,isStale:Hf(e,n),refetch:this.refetch,promise:this.#o,isEnabled:bn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=M.data!==void 0,W=M.status==="error"&&!F,I=U=>{W?U.reject(M.error):F&&U.resolve(M.data)},q=()=>{const U=this.#o=M.promise=_p();I(U)},L=this.#o;switch(L.status){case"pending":e.queryHash===s.queryHash&&I(L);break;case"fulfilled":(W||M.data!==L.value)&&q();break;case"rejected":(!W||M.error!==L.reason)&&q();break}}return M}updateResult(){const e=this.#s,n=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#i=this.options,this.#r.data!==void 0&&(this.#p=this.#e),mo(n,e))return;this.#s=n;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(l=>{const u=l;return this.#s[u]!==e[u]&&o.has(u)})};this.#w({listeners:s()})}#b(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const n=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#j()}#w(e){mt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#s)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function A5(e,n){return bn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&bn(n.retryOnMount,e)===!1)}function Sx(e,n){return A5(e,n)||e.state.data!==void 0&&Bp(e,n,n.refetchOnMount)}function Bp(e,n,s){if(bn(n.enabled,e)!==!1&&xr(n.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&Hf(e,n)}return!1}function Cx(e,n,s,r){return(e!==n||bn(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Hf(e,s)}function Hf(e,n){return bn(n.enabled,e)!==!1&&e.isStaleByTime(xr(n.staleTime,e))}function P5(e,n){return!mo(e.getCurrentResult(),n)}var R5=class extends fj{#t;#e;#n;#s;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||gj(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=pj({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(o,l)=>{this.#r({type:"failed",failureCount:o,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#s.canStart();try{if(r)n();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const l=await this.options.onMutate?.(e,s);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,s),await this.options.onSuccess?.(o,e,this.state.context,s),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(o,null,e,this.state.context,s),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,s)}catch(l){Promise.reject(l)}try{await this.options.onError?.(o,e,this.state.context,s)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,s)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,s)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),mt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function gj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var I5=class extends Xr{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,n,s){const r=new R5({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:s});return this.add(r),r}add(e){this.#t.add(e);const n=xc(e);if(typeof n=="string"){const s=this.#e.get(n);s?s.push(e):this.#e.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const n=xc(e);if(typeof n=="string"){const s=this.#e.get(n);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#e.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=xc(e);if(typeof n=="string"){const r=this.#e.get(n)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const n=xc(e);return typeof n=="string"?this.#e.get(n)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){mt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const n={exact:!0,...e};return this.getAll().find(s=>jx(n,s))}findAll(e={}){return this.getAll().filter(n=>jx(e,n))}notify(e){mt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return mt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ut))))}};function xc(e){return e.options.scope?.id}var F5=class extends Xr{#t;#e=void 0;#n;#s;constructor(n,s){super(),this.#t=n,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const s=this.options;this.options=this.#t.defaultMutationOptions(n),mo(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Hr(s.mutationKey)!==Hr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#r(),this.#i(n)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(n,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(n)}#r(){const n=this.#n?.state??gj();this.#e={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#i(n){mt.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(n?.type==="success"){try{this.#s.onSuccess?.(n.data,s,r,i)}catch(o){Promise.reject(o)}try{this.#s.onSettled?.(n.data,null,s,r,i)}catch(o){Promise.reject(o)}}else if(n?.type==="error"){try{this.#s.onError?.(n.error,s,r,i)}catch(o){Promise.reject(o)}try{this.#s.onSettled?.(void 0,n.error,s,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(s=>{s(this.#e)})})}};function $x(e,n){const s=new Set(n);return e.filter(r=>!s.has(r))}function z5(e,n,s){const r=e.slice(0);return r[n]=s,r}var L5=class extends Xr{#t;#e;#n;#s;#r;#i;#o;#a;#u;#l=[];constructor(e,n,s){super(),this.#t=e,this.#s=s,this.#n=[],this.#r=[],this.#e=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(n=>{this.#m(e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,n){this.#n=e,this.#s=n,mt.batch(()=>{const s=this.#r,r=this.#c(this.#n);r.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const i=r.map(f=>f.observer),o=i.map(f=>f.getCurrentResult()),l=s.length!==i.length,u=i.some((f,m)=>f!==s[m]),d=l||u,p=d?!0:o.some((f,m)=>{const x=this.#e[m];return!x||!mo(f,x)});!d&&!p||(d&&(this.#l=r,this.#r=i),this.#e=o,this.hasListeners()&&(d&&($x(s,i).forEach(f=>{f.destroy()}),$x(i,s).forEach(f=>{f.subscribe(m=>{this.#m(f,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,n){const s=this.#c(e),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#d(o??r,n,i),()=>this.#p(r,s)]}#p(e,n){return n.map((s,r)=>{const i=e[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{n.forEach(l=>{l.observer.trackProp(o)})})})}#d(e,n,s){if(n){const r=this.#u,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#i||this.#e!==this.#a||i||n!==this.#o)&&(this.#o=n,this.#a=this.#e,s!==void 0&&(this.#u=s),this.#i=Df(this.#i,n(e))),this.#i}return e}#f(){return this.#s?.combine!==void 0&&this.#r.some((e,n)=>e.options.suspense&&this.#e[n]?.data===void 0)}#c(e){const n=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const o=n.get(i);o?o.push(r):n.set(i,[r])});const s=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=n.get(i.queryHash)?.shift()??new Uf(this.#t,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#m(e,n){const s=this.#r.indexOf(e);s!==-1&&(this.#e=z5(this.#e,s,n),this.#h())}#h(){if(this.hasListeners()){const e=this.#p(this.#e,this.#l),n=this.#f(),s=this.#i,r=n?s:this.#d(e,this.#s?.combine);(n||s!==r)&&mt.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}},M5=class extends Xr{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,n,s){const r=n.queryKey,i=n.queryHash??_f(r,n);let o=this.get(i);return o||(o=new E5({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#t.get(e.queryHash);n&&(e.destroy(),n===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){mt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>yx(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>yx(e,s)):n}notify(e){mt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){mt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},q5=class{#t;#e;#n;#s;#r;#i;#o;#a;constructor(e={}){this.#t=e.queryCache||new M5,this.#e=e.mutationCache||new I5,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Of.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=Uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),s=this.#t.build(this,n),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(xr(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:n,state:s})=>{const r=s.data;return[n,r]})}setQueryData(e,n,s){const r=this.defaultQueryOptions({queryKey:e}),o=this.#t.get(r.queryHash)?.state.data,l=g5(n,o);if(l!==void 0)return this.#t.build(this,r).setData(l,{...s,manual:!0})}setQueriesData(e,n,s){return mt.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,s)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state}removeQueries(e){const n=this.#t;mt.batch(()=>{n.findAll(e).forEach(s=>{n.remove(s)})})}resetQueries(e,n){const s=this.#t;return mt.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const s={revert:!0,...n},r=mt.batch(()=>this.#t.findAll(e).map(i=>i.cancel(s)));return Promise.all(r).then(Ut).catch(Ut)}invalidateQueries(e,n={}){return mt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const s={...n,cancelRefetch:n.cancelRefetch??!0},r=mt.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,s);return s.throwOnError||(o=o.catch(Ut)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ut)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const s=this.#t.build(this,n);return s.isStaleByTime(xr(n.staleTime,s))?s.fetch(n):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ut).catch(Ut)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ut).catch(Ut)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Uc.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#s.set(Hr(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#s.values()],s={};return n.forEach(r=>{fo(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,n){this.#r.set(Hr(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],s={};return n.forEach(r=>{fo(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=_f(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Bf&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},xj=C.createContext(void 0),Hn=e=>{const n=C.useContext(xj);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},O5=({client:e,children:n})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),t.jsx(xj.Provider,{value:e,children:n})),yj=C.createContext(!1),jj=()=>C.useContext(yj);yj.Provider;function _5(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var D5=C.createContext(_5()),kj=()=>C.useContext(D5),vj=(e,n,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?Wf(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(n.isReset()||(e.retryOnMount=!1))},bj=e=>{C.useEffect(()=>{e.clearReset()},[e])},wj=({result:e,errorResetBoundary:n,throwOnError:s,query:r,suspense:i})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Wf(s,[e.error,r])),Nj=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},B5=(e,n)=>e.isLoading&&e.isFetching&&!n,Wp=(e,n)=>e?.suspense&&n.isPending,Up=(e,n,s)=>n.fetchOptimistic(e).catch(()=>{s.clearReset()});function W5({queries:e,...n},s){const r=Hn(),i=jj(),o=kj(),l=C.useMemo(()=>e.map(k=>{const b=r.defaultQueryOptions(k);return b._optimisticResults=i?"isRestoring":"optimistic",b}),[e,r,i]);l.forEach(k=>{Nj(k);const b=r.getQueryCache().get(k.queryHash);vj(k,o,b)}),bj(o);const[u]=C.useState(()=>new L5(r,l,n)),[d,p,f]=u.getOptimisticResult(l,n.combine),m=!i&&n.subscribed!==!1;C.useSyncExternalStore(C.useCallback(k=>m?u.subscribe(mt.batchCalls(k)):Ut,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setQueries(l,n)},[l,n,u]);const y=d.some((k,b)=>Wp(l[b],k))?d.flatMap((k,b)=>{const S=l[b];if(S&&Wp(S,k)){const N=new Uf(r,S);return Up(S,N,o)}return[]}):[];if(y.length>0)throw Promise.all(y);const j=d.find((k,b)=>{const S=l[b];return S&&wj({result:k,errorResetBoundary:o,throwOnError:S.throwOnError,query:r.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(j?.error)throw j.error;return p(f())}function U5(e,n,s){const r=jj(),i=kj(),o=Hn(),l=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Nj(l),vj(l,i,u),bj(i);const d=!o.getQueryCache().get(l.queryHash),[p]=C.useState(()=>new n(o,l)),f=p.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(x=>{const y=m?p.subscribe(mt.batchCalls(x)):Ut;return p.updateResult(),y},[p,m]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),C.useEffect(()=>{p.setOptions(l)},[l,p]),Wp(l,f))throw Up(l,p,i);if(wj({result:f,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(l,f),l.experimental_prefetchInRender&&!go.isServer()&&B5(f,r)&&(d?Up(l,p,i):u?.promise)?.catch(Ut).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?f:p.trackResult(f)}function $e(e,n){return U5(e,Uf)}function Sj(e,n){const s=Hn(),[r]=C.useState(()=>new F5(s,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(l=>r.subscribe(mt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=C.useCallback((l,u)=>{r.mutate(l,u).catch(Ut)},[r]);if(i.error&&Wf(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var ro=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Bh(e){const n=C.useRef({value:e,prev:null}),s=n.current.value;return e!==s&&(n.current={value:e,prev:s}),n.current.prev}function H5(e,n,s={},r={}){C.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{n(o)},s);return i.observe(e.current),()=>{i.disconnect()}},[n,s,r.disabled,e])}function V5(e){const n=C.useRef(null);return C.useImperativeHandle(e,()=>n.current,[]),n}const Cj=!1;function xo(e){return e[e.length-1]}function K5(e){return typeof e=="function"}function pr(e,n){return K5(e)?e(n):e}const $j=Object.prototype.hasOwnProperty,Tx=Object.prototype.propertyIsEnumerable;function Tj(e){for(const n in e)if($j.call(e,n))return!0;return!1}const Y5=()=>Object.create(null),zr=(e,n)=>fr(e,n,Y5);function fr(e,n,s=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const i=n,o=Px(e)&&Px(i);if(!o&&!(Wi(e)&&Wi(i)))return i;const l=o?e:Ex(e);if(!l)return i;const u=o?i:Ex(i);if(!u)return i;const d=l.length,p=u.length,f=o?new Array(p):s();let m=0;for(let x=0;x<p;x++){const y=o?x:u[x],j=e[y],k=i[y];if(j===k){f[y]=j,(o?x<d:$j.call(e,y))&&m++;continue}if(j===null||k===null||typeof j!="object"||typeof k!="object"){f[y]=k;continue}const b=fr(j,k,s,r+1);f[y]=b,b===j&&m++}return d===p&&m===d?e:f}function Ex(e){const n=Object.getOwnPropertyNames(e);for(const i of n)if(!Tx.call(e,i))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return n;const r=n;for(const i of s){if(!Tx.call(e,i))return!1;r.push(i)}return r}function Wi(e){if(!Ax(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const s=n.prototype;return!(!Ax(s)||!s.hasOwnProperty("isPrototypeOf"))}function Ax(e){return Object.prototype.toString.call(e)==="[object Object]"}function Px(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Or(e,n,s){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Or(e[r],n[r],s))return!1;return!0}if(Wi(e)&&Wi(n)){const r=s?.ignoreUndefined??!0;if(s?.partial){for(const l in n)if((!r||n[l]!==void 0)&&!Or(e[l],n[l],s))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let o=0;for(const l in n)if((!r||n[l]!==void 0)&&(o++,o>i||!Or(e[l],n[l],s)))return!1;return i===o}return!1}function Ui(e){let n,s;const r=new Promise((i,o)=>{n=i,s=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,n(i),e?.(i)},r.reject=i=>{r.status="rejected",s(i)},r}function yo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function G5(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Rx(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return G5(n)}const Q5=["http:","https:","mailto:","tel:"];function Hc(e,n){if(!e)return!1;try{const s=new URL(e);return!n.has(s.protocol)}catch{return!1}}function Ya(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let s=0,r="",i;for(;(i=n.exec(e))!==null;)r+=Rx(e.slice(s,i.index))+i[0],s=n.lastIndex;r=r+Rx(s?e.slice(s):e);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function Z5(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function X5(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==n[s])return!1;return!0}function Ls(){throw new Error("Invariant failed")}function jo(e){const n=new Map;let s,r;const i=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,s=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const l=n.get(o);if(l)return i(l),l.value},set(o,l){if(n.size>=e&&s){const d=s;n.delete(d.key),d.next&&(s=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=n.get(o);if(u)u.value=l,i(u);else{const d={key:o,value:l,prev:r};r&&(r.next=d),r=d,s||(s=d),n.set(o,d)}},clear(){n.clear(),s=void 0,r=void 0}}}const mr=4,Ej=5;function J5(e){const n=e.indexOf("{");if(n===-1)return null;const s=e.indexOf("}",n);return s===-1||n+1>=e.length?null:[n,s]}function Aj(e,n,s=new Uint16Array(6)){const r=e.indexOf("/",n),i=r===-1?e.length:r,o=e.substring(n,i);if(!o||!o.includes("$"))return s[0]=0,s[1]=n,s[2]=n,s[3]=i,s[4]=i,s[5]=i,s;if(o==="$"){const u=e.length;return s[0]=2,s[1]=n,s[2]=n,s[3]=u,s[4]=u,s[5]=u,s}if(o.charCodeAt(0)===36)return s[0]=1,s[1]=n,s[2]=n+1,s[3]=i,s[4]=i,s[5]=i,s;const l=J5(o);if(l){const[u,d]=l,p=o.charCodeAt(u+1);if(p===45){if(u+2<o.length&&o.charCodeAt(u+2)===36){const f=u+3,m=d;if(f<m)return s[0]=3,s[1]=n+u,s[2]=n+f,s[3]=n+m,s[4]=n+d+1,s[5]=i,s}}else if(p===36){const f=u+1,m=u+2;return m===d?(s[0]=2,s[1]=n+u,s[2]=n+f,s[3]=n+m,s[4]=n+d+1,s[5]=e.length,s):(s[0]=1,s[1]=n+u,s[2]=n+m,s[3]=n+d,s[4]=n+d+1,s[5]=i,s)}}return s[0]=0,s[1]=n,s[2]=n,s[3]=i,s[4]=i,s[5]=i,s}function bu(e,n,s,r,i,o,l){l?.(s);let u=r;{const d=s.fullPath??s.from,p=d.length,f=s.options?.caseSensitive??e,m=s.options?.params?.parse??s.options?.parseParams;for(;u<p;){const y=Aj(d,u,n);let j;const k=u,b=y[5];switch(u=b+1,o++,y[0]){case 0:{const S=d.substring(y[2],y[3]);if(f){const N=i.static?.get(S);if(N)j=N;else{i.static??=new Map;const $=qr(s.fullPath??s.from);$.parent=i,$.depth=o,j=$,i.static.set(S,$)}}else{const N=S.toLowerCase(),$=i.staticInsensitive?.get(N);if($)j=$;else{i.staticInsensitive??=new Map;const A=qr(s.fullPath??s.from);A.parent=i,A.depth=o,j=A,i.staticInsensitive.set(N,A)}}break}case 1:{const S=d.substring(k,y[1]),N=d.substring(y[4],b),$=f&&!!(S||N),A=S?$?S:S.toLowerCase():void 0,R=N?$?N:N.toLowerCase():void 0,E=!m&&i.dynamic?.find(M=>!M.parse&&M.caseSensitive===$&&M.prefix===A&&M.suffix===R);if(E)j=E;else{const M=Uh(1,s.fullPath??s.from,$,A,R);j=M,M.depth=o,M.parent=i,i.dynamic??=[],i.dynamic.push(M)}break}case 3:{const S=d.substring(k,y[1]),N=d.substring(y[4],b),$=f&&!!(S||N),A=S?$?S:S.toLowerCase():void 0,R=N?$?N:N.toLowerCase():void 0,E=!m&&i.optional?.find(M=>!M.parse&&M.caseSensitive===$&&M.prefix===A&&M.suffix===R);if(E)j=E;else{const M=Uh(3,s.fullPath??s.from,$,A,R);j=M,M.parent=i,M.depth=o,i.optional??=[],i.optional.push(M)}break}case 2:{const S=d.substring(k,y[1]),N=d.substring(y[4],b),$=f&&!!(S||N),A=S?$?S:S.toLowerCase():void 0,R=N?$?N:N.toLowerCase():void 0,E=Uh(2,s.fullPath??s.from,$,A,R);j=E,E.parent=i,E.depth=o,i.wildcard??=[],i.wildcard.push(E)}}i=j}if(m&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const y=qr(s.fullPath??s.from);y.kind=Ej,y.parent=i,o++,y.depth=o,i.pathless??=[],i.pathless.push(y),i=y}const x=(s.path||!s.children)&&!s.isRoot;if(x&&d.endsWith("/")){const y=qr(s.fullPath??s.from);y.kind=mr,y.parent=i,o++,y.depth=o,i.index=y,i=y}i.parse=m??null,x&&!i.route&&(i.route=s,i.fullPath=s.fullPath??s.from)}if(s.children)for(const d of s.children)bu(e,n,d,u,i,o,l)}function Wh(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function hr(e){if(e.pathless)for(const n of e.pathless)hr(n);if(e.static)for(const n of e.static.values())hr(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())hr(n);if(e.dynamic?.length){e.dynamic.sort(Wh);for(const n of e.dynamic)hr(n)}if(e.optional?.length){e.optional.sort(Wh);for(const n of e.optional)hr(n)}if(e.wildcard?.length){e.wildcard.sort(Wh);for(const n of e.wildcard)hr(n)}}function qr(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Uh(e,n,s,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,caseSensitive:s,prefix:r,suffix:i}}function e6(e,n){const s=qr("/"),r=new Uint16Array(6);for(const i of e)bu(!1,r,i,1,s,0);hr(s),n.masksTree=s,n.flatCache=jo(1e3)}function t6(e,n){e||="/";const s=n.flatCache.get(e);if(s)return s;const r=Vf(e,n.masksTree);return n.flatCache.set(e,r),r}function n6(e,n,s,r,i){e||="/",r||="/";const o=n?`case\0${e}`:e;let l=i.singleCache.get(o);return l||(l=qr("/"),bu(n,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(o,l)),Vf(r,l,s)}function s6(e,n,s=!1){const r=s?e:`nofuzz\0${e}`,i=n.matchCache.get(r);if(i!==void 0)return i;e||="/";let o;try{o=Vf(e,n.segmentTree,s)}catch(l){if(l instanceof URIError)o=null;else throw l}return o&&(o.branch=Rj(o.route)),n.matchCache.set(r,o),o}function r6(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function i6(e,n=!1,s){const r=qr(e.fullPath),i=new Uint16Array(6),o={},l={};let u=0;return bu(n,i,e,1,r,0,d=>{if(s?.(d,u),d.id in o&&Ls(),o[d.id]=d,u!==0&&d.path){const p=r6(d.fullPath);(!l[p]||d.fullPath.endsWith("/"))&&(l[p]=d)}u++}),hr(r),{processedTree:{segmentTree:r,singleCache:jo(1e3),matchCache:jo(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:l}}function Vf(e,n,s=!1){const r=e.split("/"),i=o6(e,r,n,s);if(!i)return null;const[o]=Pj(e,r,i);return{route:i.node.route,rawParams:o}}function Pj(e,n,s){const r=a6(s.node);let i=null;const o=Object.create(null);let l=s.extract?.part??0,u=s.extract?.node??0,d=s.extract?.path??0,p=s.extract?.segment??0;for(;u<r.length;l++,u++,d++,p++){const f=r[u];if(f.kind===mr)break;if(f.kind===Ej){p--,l--,d--;continue}const m=n[l],x=d;if(m&&(d+=m.length),f.kind===1){i??=s.node.fullPath.split("/");const y=i[p],j=f.prefix?.length??0;if(y.charCodeAt(j)===123){const k=f.suffix?.length??0,b=y.substring(j+2,y.length-k-1),S=m.substring(j,m.length-k);o[b]=decodeURIComponent(S)}else{const k=y.substring(1);o[k]=decodeURIComponent(m)}}else if(f.kind===3){if(s.skipped&1<<u){l--,d=x-1;continue}i??=s.node.fullPath.split("/");const y=i[p],j=f.prefix?.length??0,k=f.suffix?.length??0,b=y.substring(j+3,y.length-k-1),S=f.suffix||f.prefix?m.substring(j,m.length-k):m;S&&(o[b]=decodeURIComponent(S))}else if(f.kind===2){const y=f,j=e.substring(x+(y.prefix?.length??0),e.length-(y.suffix?.length??0)),k=decodeURIComponent(j);o["*"]=k,o._splat=k;break}}return s.rawParams&&Object.assign(o,s.rawParams),[o,{part:l,node:u,path:d,segment:p}]}function Rj(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function a6(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function o6(e,n,s,r){if(e==="/"&&s.index)return{node:s.index,skipped:0};const i=!xo(n),o=i&&e!=="/",l=n.length-(i?1:0),u=[{node:s,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,p=null;for(;u.length;){const f=u.pop(),{node:m,index:x,skipped:y,depth:j,statics:k,dynamics:b,optionals:S}=f;let{extract:N,rawParams:$}=f;if(m.kind===2&&m.route&&!jc(p,f))continue;if(m.parse){if(!Ix(e,n,f))continue;$=f.rawParams,N=f.extract}r&&m.route&&m.kind!==mr&&jc(d,f)&&(d=f);const A=x===l;if(A&&(m.route&&(!o||m.kind===mr||m.kind===2)&&jc(p,f)&&(p=f),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const R=A?void 0:n[x];let E;if(A&&m.index){const M={node:m.index,index:x,skipped:y,depth:j+1,statics:k,dynamics:b,optionals:S,extract:N,rawParams:$};let F=!0;if(m.index.parse&&(Ix(e,n,M)||(F=!1)),F){if(!b&&!S&&!y&&l6(k,l))return M;jc(p,M)&&(p=M)}}if(m.wildcard)for(let M=m.wildcard.length-1;M>=0;M--){const F=m.wildcard[M],{prefix:W,suffix:I}=F;if(!(W&&(A||!(F.caseSensitive?R:E??=R.toLowerCase()).startsWith(W)))){if(I){if(A)continue;const q=n.slice(x).join("/").slice(-I.length);if((F.caseSensitive?q:q.toLowerCase())!==I)continue}u.push({node:F,index:l,skipped:y,depth:j+1,statics:k,dynamics:b,optionals:S,extract:N,rawParams:$})}}if(m.optional){const M=y|1<<j,F=j+1;for(let W=m.optional.length-1;W>=0;W--){const I=m.optional[W];u.push({node:I,index:x,skipped:M,depth:F,statics:k,dynamics:b,optionals:S,extract:N,rawParams:$})}if(!A)for(let W=m.optional.length-1;W>=0;W--){const I=m.optional[W],{prefix:q,suffix:L}=I;if(q||L){const U=I.caseSensitive?R:E??=R.toLowerCase();if(q&&!U.startsWith(q)||L&&!U.endsWith(L))continue}u.push({node:I,index:x+1,skipped:y,depth:F,statics:k,dynamics:b,optionals:S+yc(l,x),extract:N,rawParams:$})}}if(!A&&m.dynamic&&R)for(let M=m.dynamic.length-1;M>=0;M--){const F=m.dynamic[M],{prefix:W,suffix:I}=F;if(W||I){const q=F.caseSensitive?R:E??=R.toLowerCase();if(W&&!q.startsWith(W)||I&&!q.endsWith(I))continue}u.push({node:F,index:x+1,skipped:y,depth:j+1,statics:k,dynamics:b+yc(l,x),optionals:S,extract:N,rawParams:$})}if(!A&&m.staticInsensitive){const M=m.staticInsensitive.get(E??=R.toLowerCase());M&&u.push({node:M,index:x+1,skipped:y,depth:j+1,statics:k+yc(l,x),dynamics:b,optionals:S,extract:N,rawParams:$})}if(!A&&m.static){const M=m.static.get(R);M&&u.push({node:M,index:x+1,skipped:y,depth:j+1,statics:k+yc(l,x),dynamics:b,optionals:S,extract:N,rawParams:$})}if(m.pathless){const M=j+1;for(let F=m.pathless.length-1;F>=0;F--){const W=m.pathless[F];u.push({node:W,index:x,skipped:y,depth:M,statics:k,dynamics:b,optionals:S,extract:N,rawParams:$})}}}if(p)return p;if(r&&d){let f=d.index;for(let x=0;x<d.index;x++)f+=n[x].length;const m=f===e.length?"/":e.slice(f);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}function yc(e,n){return 2**(e-n-1)}function l6(e,n){return e===2**(n-1)-1}function Ix(e,n,s){let r,i;try{[r,i]=Pj(e,n,s)}catch{return null}if(s.rawParams=r,s.extract=i,!s.node.parse)return!0;try{if(s.node.parse(r)===!1)return null}catch{}return!0}function jc(e,n){return e?n.statics>e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===mr)>(e.node.kind===mr)||n.node.kind===mr==(e.node.kind===mr)&&n.depth>e.depth))):!0}function zc(e){return Kf(e.filter(n=>n!==void 0).join("/"))}function Kf(e){return e.replace(/\/{2,}/g,"/")}function Ij(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function zs(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function Fj(e){return zs(Ij(e))}function Vc(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function c6(e,n,s){return Vc(e,s)===Vc(n,s)}function u6({base:e,to:n,trailingSlash:s="never",cache:r}){const i=n.startsWith("/"),o=!i&&n===".";let l;if(r){l=i?n:o?e:e+"\0"+n;const p=r.get(l);if(p)return p}let u;if(o)u=e.split("/");else if(i)u=n.split("/");else{for(u=e.split("/");u.length>1&&xo(u)==="";)u.pop();const p=n.split("/");for(let f=0,m=p.length;f<m;f++){const x=p[f];x===""?f?f===m-1&&u.push(x):u=[x]:x===".."?u.pop():x==="."||u.push(x)}}u.length>1&&(xo(u)===""?s==="never"&&u.pop():s==="always"&&u.push(""));const d=Kf(u.join("/"))||"/";return l&&r&&r.set(l,d),d}function d6(e){const n=new Map(e.map(i=>[encodeURIComponent(i),i])),s=Array.from(n.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(s,"g");return i=>i.replace(r,o=>n.get(o)??o)}function Hh(e,n,s){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>zx(i,s)).join("/"):zx(r,s)}function Fx({path:e,params:n,decoder:s,...r}){let i=!1;const o=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:i};const l=e.length;let u=0,d,p="";for(;u<l;){const f=u;d=Aj(e,f,d);const m=d[5];if(u=m+1,f===m)continue;const x=d[0];if(x===0){p+="/"+e.substring(f,m);continue}if(x===2){const y=n._splat;o._splat=y,o["*"]=y;const j=e.substring(f,d[1]),k=e.substring(d[4],m);if(!y){i=!0,(j||k)&&(p+="/"+j+k);continue}const b=Hh("_splat",n,s);p+="/"+j+b+k;continue}if(x===1){const y=e.substring(d[2],d[3]);!i&&!(y in n)&&(i=!0),o[y]=n[y];const j=e.substring(f,d[1]),k=e.substring(d[4],m),b=Hh(y,n,s)??"undefined";p+="/"+j+b+k;continue}if(x===3){const y=e.substring(d[2],d[3]),j=n[y];if(j==null)continue;o[y]=j;const k=e.substring(f,d[1]),b=e.substring(d[4],m),S=Hh(y,n,s)??"";p+="/"+k+S+b;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:o,interpolatedPath:p||"/",isMissingParams:i}}function zx(e,n){const s=encodeURIComponent(e);return n?.(s)??s}function Vt(e){return e?.isNotFound===!0}function h6(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const p6="tsr-scroll-restoration-v1_3";function f6(){const e=h6();if(!e)return null;let n={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Wi(r)&&(n=r)}catch{}return{get state(){return n},set:r=>{n=pr(r,n)||n},persist:()=>{try{e.setItem(p6,JSON.stringify(n))}catch{}}}}const Lx=f6(),m6=e=>e.state.__TSR_key||e.href;function g6(e){const n=[];let s;for(;s=e.parentNode;)n.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${n.reverse().join(" > ")}`.toLowerCase()}let kc=!1;const Ga="window",Mx="data-scroll-restoration-id";function x6(e,n){if(!Lx)return;const s=Lx;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!s)return;e.isScrollRestorationSetup=!0,kc=!1;const r=e.options.getScrollRestorationKey||m6,i=new Map;window.history.scrollRestoration="manual";const o=u=>{if(!(kc||!e.isScrollRestoring))if(u.target===document||u.target===window)i.set(Ga,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const d=u.target;i.set(d,{scrollX:d.scrollLeft||0,scrollY:d.scrollTop||0})}},l=u=>{if(!e.isScrollRestoring||!u||i.size===0||!s)return;const d=s.state[u]||={};for(const[p,f]of i){let m;if(p===Ga)m=Ga;else if(p.isConnected){const x=p.getAttribute(Mx);m=x?`[${Mx}="${x}"]`:g6(p)}m&&(d[m]=f)}};document.addEventListener("scroll",o,!0),e.subscribe("onBeforeLoad",u=>{l(u.fromLocation?r(u.fromLocation):void 0),i.clear()}),window.addEventListener("pagehide",()=>{l(r(e.stores.resolvedLocation.get()??e.stores.location.get())),s.persist()}),e.subscribe("onRendered",u=>{const d=r(u.toLocation),p=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){kc=!0;try{const m=e.isScrollRestoring?s.state[d]:void 0;let x=!1;if(m)for(const y in m){const j=m[y];if(!Wi(j))continue;const{scrollX:k,scrollY:b}=j;if(!(!Number.isFinite(k)||!Number.isFinite(b))){if(y===Ga)window.scrollTo({top:b,left:k,behavior:p}),x=!0;else if(y){let S;try{S=document.querySelector(y)}catch{continue}S&&(S.scrollLeft=k,S.scrollTop=b,x=!0)}}}if(!x){const y=e.history.location.hash.slice(1);if(y){const j=window.history.state?.__hashScrollIntoViewOptions??!0;if(j){const k=document.getElementById(y);k&&k.scrollIntoView(j)}}else{const j={top:0,left:0,behavior:p};if(window.scrollTo(j),f)for(const k of f){if(k===Ga)continue;const b=typeof k=="function"?k():document.querySelector(k);b&&b.scrollTo(j)}}}}finally{kc=!1}e.isScrollRestoring&&s.set(m=>(m[d]||={},m))}})}function y6(e,n=String){const s=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&s.set(r,n(i))}return s.toString()}function Vh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function j6(e){const n=new URLSearchParams(e),s=Object.create(null);for(const[r,i]of n.entries()){const o=s[r];o==null?s[r]=Vh(i):Array.isArray(o)?o.push(Vh(i)):s[r]=[o,Vh(i)]}return s}const k6=b6(JSON.parse),v6=w6(JSON.stringify,JSON.parse);function b6(e){return n=>{n[0]==="?"&&(n=n.substring(1));const s=j6(n);for(const r in s){const i=s[r];if(typeof i=="string")try{s[r]=e(i)}catch{}}return s}}function w6(e,n){const s=typeof n=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(s&&typeof i=="string")try{return n(i),e(i)}catch{}return i}return i=>{const o=y6(i,r);return o?`?${o}`:""}}const _r="__root__";function Wo(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:n});if(s.options=e,e.throw)throw s;return s}function un(e){return e instanceof Response&&!!e.options}function N6(e){return{input:({url:n})=>{for(const s of e)n=Hp(s,n);return n},output:({url:n})=>{for(let s=e.length-1;s>=0;s--)n=zj(e[s],n);return n}}}function S6(e){const n=Fj(e.basepath),s=`/${n}`,r=`${s}/`,i=e.caseSensitive?s:s.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===i?l.pathname="/":u.startsWith(o)&&(l.pathname=l.pathname.slice(s.length)),l},output:({url:l})=>(l.pathname=zc(["/",n,l.pathname]),l)}}function Hp(e,n){const s=e?.input?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function zj(e,n){const s=e?.output?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function C6(e,n){const{createMutableStore:s,createReadonlyStore:r,batch:i,init:o}=n,l=new Map,u=new Map,d=new Map,p=s(e.status),f=s(e.loadedAt),m=s(e.isLoading),x=s(e.isTransitioning),y=s(e.location),j=s(e.resolvedLocation),k=s(e.statusCode),b=s(e.redirect),S=s([]),N=s([]),$=s([]),A=r(()=>Kh(l,S.get())),R=r(()=>Kh(u,N.get())),E=r(()=>Kh(d,$.get())),M=r(()=>S.get()[0]),F=r(()=>S.get().some(V=>l.get(V)?.get().status==="pending")),W=r(()=>({locationHref:y.get().href,resolvedLocationHref:j.get()?.href,status:p.get()})),I=r(()=>({status:p.get(),loadedAt:f.get(),isLoading:m.get(),isTransitioning:x.get(),matches:A.get(),location:y.get(),resolvedLocation:j.get(),statusCode:k.get(),redirect:b.get()})),q=jo(64);function L(V){let Y=q.get(V);return Y||(Y=r(()=>{const te=S.get();for(const P of te){const B=l.get(P);if(B&&B.routeId===V)return B.get()}}),q.set(V,Y)),Y}const U={status:p,loadedAt:f,isLoading:m,isTransitioning:x,location:y,resolvedLocation:j,statusCode:k,redirect:b,matchesId:S,pendingIds:N,cachedIds:$,matches:A,pendingMatches:R,cachedMatches:E,firstId:M,hasPending:F,matchRouteDeps:W,matchStores:l,pendingMatchStores:u,cachedMatchStores:d,__store:I,getRouteMatchStore:L,setMatches:_,setPending:G,setCached:le};_(e.matches),o?.(U);function _(V){Yh(V,l,S,s,i)}function G(V){Yh(V,u,N,s,i)}function le(V){Yh(V,d,$,s,i)}return U}function Kh(e,n){const s=[];for(const r of n){const i=e.get(r);i&&s.push(i.get())}return s}function Yh(e,n,s,r,i){const o=e.map(u=>u.id),l=new Set(o);i(()=>{for(const u of n.keys())l.has(u)||n.delete(u);for(const u of e){const d=n.get(u.id);if(!d){const p=r(u);p.routeId=u.routeId,n.set(u.id,p);continue}d.routeId=u.routeId,d.get()!==u&&d.set(u)}X5(s.get(),o)||s.set(o)})}const Vp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},$6=e=>e.stores.matchesId.get().some(n=>e.stores.matchStores.get(n)?.get()._forcePending),wu=(e,n)=>!!(e.preload&&!e.router.stores.matchStores.has(n)),Dr=(e,n,s=!0)=>{const r={...e.router.options.context??{}},i=s?n:n-1;for(let o=0;o<=i;o++){const l=e.matches[o];if(!l)continue;const u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},qx=(e,n)=>{if(!e.matches.length)return;const s=n.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let o=s?e.matches.findIndex(l=>l.routeId===s):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=i);for(let l=o;l>=0;l--){const u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return s?o:i},gr=(e,n,s)=>{if(!(!un(s)&&!Vt(s)))throw un(s)&&s.redirectHandled&&!s.options.reloadDocument||(n&&(n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0,n._nonReactive.error=s,e.updateMatch(n.id,r=>({...r,status:un(s)?"redirected":Vt(s)?"notFound":r.status==="pending"?"success":r.status,context:Dr(e,n.index),isFetching:!1,error:s})),Vt(s)&&!s.routeId&&(s.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()),un(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},Lj=(e,n)=>{const s=e.router.getMatch(n);return!!(!s||s._nonReactive.dehydrated)},Ox=(e,n,s)=>{const r=Dr(e,s);e.updateMatch(n,i=>({...i,context:r}))},Qa=(e,n,s,r)=>{const{id:i,routeId:o}=e.matches[n],l=e.router.looseRoutesById[o];if(s instanceof Promise)throw s;s.routerCode=r,e.firstBadMatchIndex??=n,gr(e,e.router.getMatch(i),s);try{l.options.onError?.(s)}catch(u){s=u,gr(e,e.router.getMatch(i),s)}e.updateMatch(i,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!un(s)&&!Vt(s)&&(e.serialError??=s)},Mj=(e,n,s,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!wu(e,n)&&(s.options.loader||s.options.beforeLoad||Oj(s))&&typeof i=="number"&&i!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{Vp(e)},i);r._nonReactive.pendingTimeout=o}},T6=(e,n,s)=>{const r=e.router.getMatch(n);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Mj(e,n,s,r);const i=()=>{const o=e.router.getMatch(n);o.preload&&(o.status==="redirected"||o.status==="notFound")&&gr(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},E6=(e,n,s,r)=>{const i=e.router.getMatch(n);let o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ui(()=>{o?.resolve(),o=void 0});const{paramsError:l,searchError:u}=i;l&&Qa(e,s,l,"PARSE_PARAMS"),u&&Qa(e,s,u,"VALIDATE_SEARCH"),Mj(e,n,r,i);const d=new AbortController;let p=!1;const f=()=>{p||(p=!0,e.updateMatch(n,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{f(),m()});return}i._nonReactive.beforeLoadPromise=Ui();const x={...Dr(e,s,!1),...i.__routeContext},{search:y,params:j,cause:k}=i,b=wu(e,n),S={search:y,abortController:d,params:j,preload:b,context:x,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":k,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},N=A=>{if(A===void 0){e.router.batch(()=>{f(),m()});return}(un(A)||Vt(A))&&(f(),Qa(e,s,A,"BEFORE_LOAD")),e.router.batch(()=>{f(),e.updateMatch(n,R=>({...R,__beforeLoadContext:A})),m()})};let $;try{if($=r.options.beforeLoad(S),yo($))return f(),$.catch(A=>{Qa(e,s,A,"BEFORE_LOAD")}).then(N)}catch(A){f(),Qa(e,s,A,"BEFORE_LOAD")}N($)},A6=(e,n)=>{const{id:s,routeId:r}=e.matches[n],i=e.router.looseRoutesById[r],o=()=>u(),l=()=>E6(e,s,n,i),u=()=>{if(Lj(e,s))return;const d=T6(e,s,i);return yo(d)?d.then(l):l()};return o()},P6=(e,n,s)=>{const r=e.router.getMatch(n);if(!r||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([s.options.head?.(i),s.options.scripts?.(i),s.options.headers?.(i)]).then(([o,l,u])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:u,scripts:l,styles:o?.styles}))},qj=(e,n,s,r,i)=>{const o=n[r-1],{params:l,loaderDeps:u,abortController:d,cause:p}=e.router.getMatch(s),f=Dr(e,r),m=wu(e,s);return{params:l,deps:u,preload:!!m,parentMatchPromise:o,abortController:d,context:f,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:m?"preload":p,route:i,...e.router.options.additionalContext}},_x=async(e,n,s,r,i)=>{try{const o=e.router.getMatch(s);try{(!(Cj??e.router.isServer)||o.ssr===!0)&&ko(i);const l=i.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(qj(e,n,s,r,i)),p=!!u&&yo(d);if((p||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(s,m=>({...m,isFetching:"loader"})),u){const m=p?await d:d;gr(e,e.router.getMatch(s),m),m!==void 0&&e.updateMatch(s,x=>({...x,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const f=o._nonReactive.minPendingPromise;f&&await f,i._componentsPromise&&await i._componentsPromise,e.updateMatch(s,m=>({...m,error:void 0,context:Dr(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:Dr(e,r)}));return}const d=o._nonReactive.minPendingPromise;d&&await d,Vt(l)&&await i.options.notFoundComponent?.preload?.(),gr(e,e.router.getMatch(s),l);try{i.options.onError?.(l)}catch(p){u=p,gr(e,e.router.getMatch(s),p)}!un(u)&&!Vt(u)&&await ko(i,["errorComponent"]),e.updateMatch(s,p=>({...p,error:u,context:Dr(e,r),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(s);l&&(l._nonReactive.loaderPromise=void 0),gr(e,l,o)}},R6=async(e,n,s)=>{async function r(y,j,k,b,S){const N=Date.now()-j.updatedAt,$=y?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,A=S.options.shouldReload,R=typeof A=="function"?A(qj(e,n,i,s,S)):A,{status:E,invalid:M}=b,F=N>=$&&(!!e.forceStaleReload||b.cause==="enter"||k!==void 0&&k!==b.id);l=E==="success"&&(M||(R??F)),y&&S.options.preload===!1||(l&&!e.sync&&f?(u=!0,(async()=>{try{await _x(e,n,i,s,S);const W=e.router.getMatch(i);W._nonReactive.loaderPromise?.resolve(),W._nonReactive.loadPromise?.resolve(),W._nonReactive.loaderPromise=void 0,W._nonReactive.loadPromise=void 0}catch(W){un(W)&&await e.router.navigate(W.options)}})()):E!=="success"||l?await _x(e,n,i,s,S):Ox(e,i,s))}const{id:i,routeId:o}=e.matches[s];let l=!1,u=!1;const d=e.router.looseRoutesById[o],p=d.options.loader,f=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Lj(e,i)){if(!e.router.getMatch(i))return e.matches[s];Ox(e,i,s)}else{const y=e.router.getMatch(i),j=e.router.stores.matchesId.get()[s],k=(j&&e.router.stores.matchStores.get(j)||null)?.routeId===o?j:e.router.stores.matches.get().find(S=>S.routeId===o)?.id,b=wu(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&f)return y;await y._nonReactive.loaderPromise;const S=e.router.getMatch(i),N=S._nonReactive.error||S.error;N&&gr(e,S,N),S.status==="pending"&&await r(b,y,k,S,d)}else{const S=b&&!e.router.stores.matchStores.has(i),N=e.router.getMatch(i);N._nonReactive.loaderPromise=Ui(),S!==N.preload&&e.updateMatch(i,$=>({...$,preload:S})),await r(b,y,k,N,d)}}const m=e.router.getMatch(i);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const x=u?m.isFetching:!1;return x!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,y=>({...y,isFetching:x,invalid:!1})),e.router.getMatch(i)):m};async function Dx(e){const n=e,s=[];$6(n.router)&&Vp(n);let r;for(let x=0;x<n.matches.length;x++){try{const y=A6(n,x);yo(y)&&await y}catch(y){if(un(y))throw y;if(Vt(y))r=y;else if(!n.preload)throw y;break}if(n.serialError||n.firstBadMatchIndex!=null)break}const i=n.firstBadMatchIndex??n.matches.length,o=r&&!n.preload?qx(n,r):void 0,l=r&&n.preload?0:o!==void 0?Math.min(o+1,i):i;let u,d;for(let x=0;x<l;x++)s.push(R6(n,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const y of x){if(y.status!=="rejected")continue;const j=y.reason;if(un(j))throw j;Vt(j)?u??=j:d??=j}if(d!==void 0)throw d}const p=u??(r&&!n.preload?r:void 0);let f=n.firstBadMatchIndex!==void 0?n.firstBadMatchIndex:n.matches.length-1;if(!p&&r&&n.preload)return n.matches;if(p){const x=qx(n,p);x===void 0&&Ls();const y=n.matches[x],j=n.router.looseRoutesById[y.routeId],k=n.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&k&&(j.options.notFoundComponent=k),p.routeId=y.routeId;const b=y.routeId===n.router.routeTree.id;n.updateMatch(y.id,S=>({...S,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),f=x,await ko(j,["notFoundComponent"])}else if(!n.preload){const x=n.matches[0];x.globalNotFound||n.router.getMatch(x.id)?.globalNotFound&&n.updateMatch(x.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(n.serialError&&n.firstBadMatchIndex!==void 0){const x=n.router.looseRoutesById[n.matches[n.firstBadMatchIndex].routeId];await ko(x,["errorComponent"])}for(let x=0;x<=f;x++){const{id:y,routeId:j}=n.matches[x],k=n.router.looseRoutesById[j];try{const b=P6(n,y,k);if(b){const S=await b;n.updateMatch(y,N=>({...N,...S}))}}catch(b){console.error(`Error executing head for route ${j}:`,b)}}const m=Vp(n);if(yo(m)&&await m,p)throw p;if(n.serialError&&!n.preload&&!n.onReady)throw n.serialError;return n.matches}function Bx(e,n){const s=n.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function ko(e,n=Lc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...o}=r.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:n===Lc?(()=>{if(e._componentsPromise===void 0){const r=Bx(e,Lc);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Bx(e,n);return e._lazyPromise?e._lazyPromise.then(s):s()}function Oj(e){for(const n of Lc)if(e.options[n]?.preload)return!0;return!1}const Lc=["component","errorComponent","pendingComponent","notFoundComponent"];var yr="__TSR_index",Wx="popstate",Ux="beforeunload";function I6(e){let n=e.getLocation();const s=new Set,r=l=>{n=e.getLocation(),s.forEach(u=>u({location:n,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):n=e.getLocation()},o=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const p=e.getBlockers?.()??[],f=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const m of p){const x=Kc(d.path,d.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return n},get length(){return e.getLength()},subscribers:s,subscribe:l=>(s.add(l),()=>{s.delete(l)}),push:(l,u,d)=>{const p=n.state[yr];u=Hx(p+1,u),o({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const p=n.state[yr];u=Hx(p,u),o({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{o({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{o({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{o({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>n.state[yr]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Hx(e,n){n||(n={});const s=Yf();return{...n,key:s,__TSR_key:s,[yr]:e}}function F6(e){const n=typeof document<"u"?window:void 0,s=n.history.pushState,r=n.history.replaceState;let i=[];const o=()=>i,l=F=>i=F,u=(F=>F),d=(()=>Kc(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const F=Yf();n.history.replaceState({[yr]:0,key:F,__TSR_key:F},"")}let p=d(),f,m=!1,x=!1,y=!1,j=!1;const k=()=>p;let b,S;const N=()=>{b&&(M._ignoreSubscribers=!0,(b.isPush?n.history.pushState:n.history.replaceState)(b.state,"",b.href),M._ignoreSubscribers=!1,b=void 0,S=void 0,f=void 0)},$=(F,W,I)=>{const q=u(W);S||(f=p),p=Kc(W,I),b={href:q,state:I,isPush:b?.isPush||F==="push"},S||(S=Promise.resolve().then(()=>N()))},A=F=>{p=d(),M.notify({type:F})},R=async()=>{if(x){x=!1;return}const F=d(),W=F.state[yr]-p.state[yr],I=W===1,q=W===-1,L=!I&&!q||m;m=!1;const U=L?"GO":q?"BACK":"FORWARD",_=L?{type:"GO",index:W}:{type:q?"BACK":"FORWARD"};if(y)y=!1;else{const G=o();if(typeof document<"u"&&G.length){for(const le of G)if(await le.blockerFn({currentLocation:p,nextLocation:F,action:U})){x=!0,n.history.go(1),M.notify(_);return}}}p=d(),M.notify(_)},E=F=>{if(j){j=!1;return}let W=!1;const I=o();if(typeof document<"u"&&I.length)for(const q of I){const L=q.enableBeforeUnload??!0;if(L===!0){W=!0;break}if(typeof L=="function"&&L()===!0){W=!0;break}}if(W)return F.preventDefault(),F.returnValue=""},M=I6({getLocation:k,getLength:()=>n.history.length,pushState:(F,W)=>$("push",F,W),replaceState:(F,W)=>$("replace",F,W),back:F=>(F&&(y=!0),j=!0,n.history.back()),forward:F=>{F&&(y=!0),j=!0,n.history.forward()},go:F=>{m=!0,n.history.go(F)},createHref:F=>u(F),flush:N,destroy:()=>{n.history.pushState=s,n.history.replaceState=r,n.removeEventListener(Ux,E,{capture:!0}),n.removeEventListener(Wx,R)},onBlocked:()=>{f&&p!==f&&(p=f)},getBlockers:o,setBlockers:l,notifyOnIndexChange:!1});return n.addEventListener(Ux,E,{capture:!0}),n.addEventListener(Wx,R),n.history.pushState=function(...F){const W=s.apply(n.history,F);return M._ignoreSubscribers||A("PUSH"),W},n.history.replaceState=function(...F){const W=r.apply(n.history,F);return M._ignoreSubscribers||A("REPLACE"),W},M}function z6(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Kc(e,n){const s=z6(e),r=s.indexOf("#"),i=s.indexOf("?"),o=Yf();return{href:s,pathname:s.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:s.length),hash:r>-1?s.substring(r):"",search:i>-1?s.slice(i,r===-1?void 0:r):"",state:n||{[yr]:0,key:o,__TSR_key:o}}}function Yf(){return(Math.random()+1).toString(36).substring(7)}function _i(e,n){const s=n,r=e;return{fromLocation:s,toLocation:r,pathChanged:s?.pathname!==r.pathname,hrefChanged:s?.href!==r.href,hashChanged:s?.hash!==r.hash}}var L6=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=s=>s(),this.update=s=>{const r=this.options,i=this.basepath??r?.basepath??"/",o=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=d6(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=F6()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=jo(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=C6(q6(this.latestLocation),f),x6(this)}let u=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(o||i!==d||l!==p){this.basepath=d;const f=[],m=Fj(d);m&&m!=="/"&&f.push(S6({basepath:d})),p&&f.push(p),this.rewrite=f.length===0?void 0:f.length===1?f[0]:N6(f),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=i6(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&e6(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,r)=>{const i={eventType:s,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=s=>{this.subscribers.forEach(r=>{r.eventType===s.type&&r.fn(s)})},this.parseLocation=(s,r)=>{const i=({pathname:d,search:p,hash:f,href:m,state:x})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const S=this.options.parseSearch(p),N=this.options.stringifySearch(S);return{href:d+N+f,publicHref:d+N+f,pathname:Ya(d).path,external:!1,searchStr:N,search:zr(r?.search,S),hash:Ya(f.slice(1)).path,state:fr(r?.state,x)}}const y=new URL(m,this.origin),j=Hp(this.rewrite,y),k=this.options.parseSearch(j.search),b=this.options.stringifySearch(k);return j.search=b,{href:j.href.replace(j.origin,""),publicHref:m,pathname:Ya(j.pathname).path,external:!!this.rewrite&&j.origin!==this.origin,searchStr:b,search:zr(r?.search,k),hash:Ya(j.hash.slice(1)).path,state:fr(r?.state,x)}},o=i(s),{__tempLocation:l,__tempKey:u}=o.state;if(l&&(!u||u===this.tempLocationKey)){const d=i(l);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(s,r)=>u6({base:s,to:r.includes("//")?Kf(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,r,i)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:r},i):this.matchRoutesInternal(s,r),this.getMatchedRoutes=s=>O6({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const r=this.getMatch(s);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{if(this.stores.pendingMatchStores.has(s))return;const r=this.stores.matchStores.get(s)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const r=(o={})=>{const l=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(l);o.from;const d=o.unsafeRelative==="path"?l.pathname:o.from??u.fullPath,p=o.to?`${o.to}`:void 0,f=u.search,m=Object.assign(Object.create(null),u.params),x=p?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),y=p?this.resolvePathWithBase(x,p):x,j=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?m:Object.assign(m,pr(o.params,m)),k=this.routesByPath[zs(y)];let b;if(k)b=this.getRouteBranch(k);else if(y.includes("$"))b=[];else{const q=this.getMatchedRoutes(y);b=q.matchedRoutes,this.options.notFoundRoute&&(!q.foundRoute||q.foundRoute.path!=="/"&&q.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&Tj(j))for(const q of b){const L=q.options.params?.stringify??q.options.stringifyParams;if(L)try{Object.assign(j,L(j))}catch{}}const S=s.leaveParams?y:Ya(Fx({path:y,params:j,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=f;if(s._includeValidateSearch&&this.options.search?.strict){const q={};b.forEach(L=>{if(L.options.validateSearch)try{Object.assign(q,Mc(L.options.validateSearch,{...q,...N}))}catch{}}),N=q}N=_6({search:N,dest:o,destRoutes:b,_includeValidateSearch:s._includeValidateSearch}),N=zr(f,N);const $=this.options.stringifySearch(N),A=o.hash===!0?l.hash:o.hash?pr(o.hash,l.hash):void 0,R=A?`#${A}`:"";let E=o.state===!0?l.state:o.state?pr(o.state,l.state):{};E=fr(l.state,E);const M=`${S}${$}${R}`;let F,W,I=!1;if(this.rewrite){const q=new URL(M,this.origin),L=zj(this.rewrite,q);F=q.href.replace(q.origin,""),L.origin!==this.origin?(W=L.href,I=!0):W=L.pathname+L.search+L.hash}else F=Z5(M),W=F;return{publicHref:W,href:F,pathname:S,search:N,searchStr:$,state:E,hash:A??"",external:I,unmaskOnReload:o.unmaskOnReload}},i=(o={},l)=>{const u=r(o);let d=l?r(l):void 0;if(!d){const p=Object.create(null);if(this.options.routeMasks){const f=t6(u.pathname,this.processedTree);if(f){Object.assign(p,f.rawParams);const{from:m,params:x,...y}=f.route,j=x===!1||x===null?Object.create(null):(x??!0)===!0?p:Object.assign(p,pr(x,p));l={from:s.from,...y,params:j},d=r(l)}}}return d&&(u.maskedLocation=d),u};return s.mask?i(s,{from:s.from,...s.mask}):i(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:r,...i})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(f=>{i.state[f]=this.latestLocation.state[f]});const p=Or(i.state,this.latestLocation.state);return d.forEach(f=>{delete i.state[f]}),p},l=zs(this.latestLocation.href)===zs(i.href);let u=this.commitLocationPromise;if(this.commitLocationPromise=Ui(()=>{u?.resolve(),u=void 0}),l&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...f}=i;d&&(f={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[i.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:r,hashScrollIntoView:i,viewTransition:o,ignoreBlocker:l,href:u,...d}={})=>{if(u){const m=this.history.location.state.__TSR_index,x=Kc(u,{__TSR_index:s?m:m+1}),y=new URL(x.pathname,this.origin);d.to=Hp(this.rewrite,y).pathname,d.search=this.options.parseSearch(x.search),d.hash=x.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const f=this.commitLocation({...p,viewTransition:o,replace:s,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:s,reloadDocument:r,href:i,publicHref:o,...l})=>{let u=!1;if(i)try{new URL(`${i}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(s!==void 0||!i){const p=this.buildLocation({to:s,...l});i=i??p.publicHref,o=o??p.publicHref}const d=!u&&o?o:i;if(Hc(d,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const f of p)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!s.some(o=>o.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(r)})},this.load=async s=>{let r,i,o;const l=this.stores.resolvedLocation.get()??this.stores.location.get();for(o=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,f=_i(p,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await Dx({router:this,sync:s?.sync,forceStaleReload:l.href===p.href,matches:this.stores.pendingMatches.get(),location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,x=null,y=null,j=null;this.batch(()=>{const k=this.stores.pendingMatches.get(),b=k.length,S=this.stores.matches.get();m=b?S.filter(A=>!this.stores.pendingMatchStores.has(A.id)):null;const N=new Set;for(const A of this.stores.pendingMatchStores.values())A.routeId&&N.add(A.routeId);const $=new Set;for(const A of this.stores.matchStores.values())A.routeId&&$.add(A.routeId);x=b?S.filter(A=>!N.has(A.routeId)):null,y=b?k.filter(A=>!$.has(A.routeId)):null,j=b?k.filter(A=>$.has(A.routeId)):S,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),b&&(this.stores.setMatches(k),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(A=>A.status!=="error"&&A.status!=="notFound"&&A.status!=="redirected")]),this.clearExpiredCache())});for(const[k,b]of[[x,"onLeave"],[y,"onEnter"],[j,"onStay"]])if(k)for(const S of k)this.looseRoutesById[S.routeId].options[b]?.(S)})})}})}catch(p){un(p)?(r=p,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Vt(p)&&(i=p);const f=r?r.status:i?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.stores.matches.get().some(d=>d.status==="error")&&(u=500),u!==void 0&&this.stores.statusCode.set(u)},this.startViewTransition=s=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(_i(o,l)):r.types;if(u===!1){s();return}i={update:s,types:u}}else i=s;document.startViewTransition(i)}else s()},this.updateMatch=(s,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(s);if(i){i.set(r);return}const o=this.stores.matchStores.get(s);if(o){o.set(r);return}const l=this.stores.cachedMatchStores.get(s);if(l){const u=r(l.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(d=>d.filter(p=>p!==s)):l.set(u)}})},this.getMatch=s=>this.stores.cachedMatchStores.get(s)?.get()??this.stores.pendingMatchStores.get(s)?.get()??this.stores.matchStores.get(s)?.get(),this.invalidate=s=>{const r=i=>s?.filter?.(i)??!0?{...i,invalid:!0,...s?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const r=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const i=s.options._builtLocation??this.buildLocation(s.options),o=this.getParsedLocationHref(i);s.options.href=o,s.headers.set("Location",o)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const o=i.pathname+i.search+i.hash;s.options.href=o,s.headers.set("Location",o)}}catch{}if(s.options.href&&!s.options._builtLocation&&Hc(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const r=s?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),r=i=>{const o=this.looseRoutesById[i.routeId];if(!o.options.loader)return!0;const l=(i.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:s-i.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=ko,this.preloadRoute=async s=>{const r=s._builtLocation??this.buildLocation(s);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:s});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...o,...this.stores.cachedIds.get()]),u=i.filter(d=>!l.has(d.id));if(u.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...u])}try{return i=await Dx({router:this,matches:i,location:r,preload:!0,updateMatch:(d,p)=>{o.has(d)?i=i.map(f=>f.id===d?p(f):f):this.updateMatch(d,p)}}),i}catch(d){if(un(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});Vt(d)||console.error(d);return}},this.matchRoute=(s,r)=>{const i={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},o=this.buildLocation(i);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=n6(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!u||s.params&&!Or(u.rawParams,s.params,{partial:!0})?!1:r?.includeSearch??!0?Or(l.search,o.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??v6,parseSearch:e.parseSearch??k6,protocolAllowlist:e.protocolAllowlist??Q5}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:s}){this.routesById=e,this.routesByPath=n,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=Rj(e),this.routeBranchCache.set(e,n)),n}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,n){const s=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=s;let{matchedRoutes:o}=s,l=!1;(r?r.path!=="/"&&i["**"]:zs(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:l=!0);const u=l?B6(this.options.notFoundMode,o):void 0,d=new Array(o.length),p=new Map;for(const f of this.stores.matchStores.values())f.routeId&&p.set(f.routeId,f.get());for(let f=0;f<o.length;f++){const m=o[f],x=d[f-1];let y,j,k;{const L=x?.search??e.search,U=x?._strictSearch??void 0;try{const _=Mc(m.options.validateSearch,{...L})??void 0;y={...L,..._},j={...U,..._},k=void 0}catch(_){let G=_;if(_ instanceof Yc||(G=new Yc(_.message,{cause:_})),n?.throwOnError)throw G;y=L,j={},k=G}}const b=m.options.loaderDeps?.({search:y})??"",S=b?JSON.stringify(b):"",{interpolatedPath:N,usedParams:$}=Fx({path:m.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),A=m.id+N+S,R=this.getMatch(A),E=p.get(m.id),M=R?._strictParams??$;let F;if(!R)try{Vx(m,M)}catch(L){if(Vt(L)||un(L)?F=L:F=new M6(L.message,{cause:L}),n?.throwOnError)throw F}Object.assign(i,M);const W=E?"stay":"enter";let I;if(R)I={...R,cause:W,params:E?.params??i,_strictParams:M,search:zr(E?E.search:R.search,y),_strictSearch:j};else{const L=m.options.loader||m.options.beforeLoad||m.lazyFn||Oj(m)?"pending":"success";I={id:A,ssr:m.options.ssr,index:f,routeId:m.id,params:E?.params??i,_strictParams:M,pathname:N,updatedAt:Date.now(),search:E?zr(E.search,y):y,_strictSearch:j,searchError:void 0,status:L,isFetching:!1,error:void 0,paramsError:F,__routeContext:void 0,_nonReactive:{loadPromise:Ui()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:E?fr(E.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(I.globalNotFound=u===m.id),I.searchError=k;const q=this.getParentContext(x);I.context={...q,...I.__routeContext,...I.__beforeLoadContext},d[f]=I}for(let f=0;f<d.length;f++){const m=d[f],x=this.looseRoutesById[m.routeId],y=this.getMatch(m.id),j=p.get(m.routeId);if(m.params=j?zr(j.params,i):i,!y){const k=d[f-1],b=this.getParentContext(k);if(x.options.context){const S={deps:m.loaderDeps,params:m.params,context:b??{},location:e,navigate:N=>this.navigate({...N,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:x.id};m.__routeContext=x.options.context(S)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const{matchedRoutes:n,routeParams:s}=this.getMatchedRoutes(e.pathname),r=xo(n),i={...e.search};for(const p of n)try{Object.assign(i,Mc(p.options.validateSearch,i))}catch{}const o=xo(this.stores.matchesId.get()),l=o&&this.stores.matchStores.get(o)?.get(),u=l&&l.routeId===r.id&&l.pathname===e.pathname;let d;if(u)d=l.params;else{const p=Object.assign(Object.create(null),s);for(const f of n)try{Vx(f,p)}catch{}d=p}return{matchedRoutes:n,fullPath:r.fullPath,search:i,params:d}}},Yc=class extends Error{},M6=class extends Error{};function q6(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Mc(e,n){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(n);if(s instanceof Promise)throw new Yc("Async validation not supported");if(s.issues)throw new Yc(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function O6({pathname:e,routesById:n,processedTree:s}){const r=Object.create(null),i=zs(e);let o;const l=s6(i,s,!0);return l&&(o=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[n.__root__],routeParams:r,foundRoute:o}}function _6({search:e,dest:n,destRoutes:s,_includeValidateSearch:r}){return D6(s)(e,n,r??!1)}function D6(e){const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&n.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:l,next:u})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((f,m)=>m(f),l));const p=u(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,m)=>m(f),p):p};n.middlewares.push(o)}if(i.options.validateSearch){const o=({search:l,next:u})=>{const d=u(l);if(!n._includeValidateSearch)return d;try{return{...d,...Mc(i.options.validateSearch,d)??void 0}}catch{return d}};n.middlewares.push(o)}}const s=({search:i})=>{const o=n.dest;return o.search?o.search===!0?i:pr(o.search,i):{}};n.middlewares.push(s);const r=(i,o,l)=>{if(i>=l.length)return o;const u=l[i];return u({search:o,next:p=>r(i+1,p,l)})};return function(o,l,u){return n.dest=l,n._includeValidateSearch=u,r(0,o,n.middlewares)}}function B6(e,n){if(e!=="root")for(let s=n.length-1;s>=0;s--){const r=n[s];if(r.children)return r.id}return _r}function Vx(e,n){const s=e.options.params?.parse??e.options.parseParams;if(s){const r=s(n);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(n,r)}}const W6="Error preloading route! ☝️";var _j=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,r=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=_r:this.parentRoute||Ls();let i=r?_r:s?.path;i&&i!=="/"&&(i=Ij(i));const o=s?.id||i;let l=r?_r:zc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=zc(["/",l]));const u=l==="__root__"?"/":zc([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=u,this._to=zs(u)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Wo({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},U6=class extends _j{constructor(e){super(e)}};function H6(e){if(typeof document<"u"&&document.querySelector){const n=e.stores.location.get(),s=n.state.__hashScrollIntoViewOptions??!0;if(s&&n.hash!==""){const r=document.getElementById(n.hash);r&&r.scrollIntoView(s)}}}function Gf(e){const n=e.errorComponent??Qf;return t.jsx(V6,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:r})=>s?C.createElement(n,{error:s,reset:r}):e.children})}var V6=class extends C.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,n){const s=e.getResetKey();return n.error&&n.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Qf({error:e}){const[n,s]=C.useState(!1);return t.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[t.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),t.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:n?"Hide Error":"Show Error"})]}),t.jsx("div",{style:{height:".25rem"}}),n?t.jsx("div",{children:t.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?t.jsx("code",{children:e.message}):null})}):null]})}function K6({children:e,fallback:n=null}){return Dj()?t.jsx(po.Fragment,{children:e}):t.jsx(po.Fragment,{children:n})}function Dj(){return po.useSyncExternalStore(Y6,()=>!0,()=>!1)}function Y6(){return()=>{}}var Bj=C.createContext(null);function hn(e){return C.useContext(Bj)}var Nu=C.createContext(void 0),G6=C.createContext(void 0),lt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(lt||{});function Q6({update:e,notify:n,unwatched:s}){return{link:r,unlink:i,propagate:o,checkDirty:l,shallowPropagate:u};function r(p,f,m){const x=f.depsTail;if(x!==void 0&&x.dep===p)return;const y=x!==void 0?x.nextDep:f.deps;if(y!==void 0&&y.dep===p){y.version=m,f.depsTail=y;return}const j=p.subsTail;if(j!==void 0&&j.version===m&&j.sub===f)return;const k=f.depsTail=p.subsTail={version:m,dep:p,sub:f,prevDep:x,nextDep:y,prevSub:j,nextSub:void 0};y!==void 0&&(y.prevDep=k),x!==void 0?x.nextDep=k:f.deps=k,j!==void 0?j.nextSub=k:p.subs=k}function i(p,f=p.sub){const m=p.dep,x=p.prevDep,y=p.nextDep,j=p.nextSub,k=p.prevSub;return y!==void 0?y.prevDep=x:f.depsTail=x,x!==void 0?x.nextDep=y:f.deps=y,j!==void 0?j.prevSub=k:m.subsTail=k,k!==void 0?k.nextSub=j:(m.subs=j)===void 0&&s(m),y}function o(p){let f=p.nextSub,m;e:do{const x=p.sub;let y=x.flags;if(y&60?y&12?y&4?!(y&48)&&d(p,x)?(x.flags=y|40,y&=1):y=0:x.flags=y&-9|32:y=0:x.flags=y|32,y&2&&n(x),y&1){const j=x.subs;if(j!==void 0){const k=(p=j).nextSub;k!==void 0&&(m={value:f,prev:m},f=k);continue}}if((p=f)!==void 0){f=p.nextSub;continue}for(;m!==void 0;)if(p=m.value,m=m.prev,p!==void 0){f=p.nextSub;continue e}break}while(!0)}function l(p,f){let m,x=0,y=!1;e:do{const j=p.dep,k=j.flags;if(f.flags&16)y=!0;else if((k&17)===17){if(e(j)){const b=j.subs;b.nextSub!==void 0&&u(b),y=!0}}else if((k&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(m={value:p,prev:m}),p=j.deps,f=j,++x;continue}if(!y){const b=p.nextDep;if(b!==void 0){p=b;continue}}for(;x--;){const b=f.subs,S=b.nextSub!==void 0;if(S?(p=m.value,m=m.prev):p=b,y){if(e(f)){S&&u(b),f=p.sub;continue}y=!1}else f.flags&=-33;f=p.sub;const N=p.nextDep;if(N!==void 0){p=N;continue e}}return y}while(!0)}function u(p){do{const f=p.sub,m=f.flags;(m&48)===32&&(f.flags=m|16,(m&6)===2&&n(f))}while((p=p.nextSub)!==void 0)}function d(p,f){let m=f.depsTail;for(;m!==void 0;){if(m===p)return!0;m=m.prevDep}return!1}}function Z6(e,n,s){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:n)?.bind(i),complete:(r?e.complete:s)?.bind(i)}}const Kp=[];let qc=0;const{link:Kx,unlink:X6,propagate:J6,checkDirty:Wj,shallowPropagate:Yx}=Q6({update(e){return e._update()},notify(e){Kp[Yp++]=e,e.flags&=~lt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=lt.Mutable|lt.Dirty,Gc(e))}});let vc=0,Yp=0,ms,Gp=0;function Uj(e){try{++Gp,e()}finally{--Gp||Hj()}}function Gc(e){const n=e.depsTail;let s=n!==void 0?n.nextDep:e.deps;for(;s!==void 0;)s=X6(s,e)}function Hj(){if(!(Gp>0)){for(;vc<Yp;){const e=Kp[vc];Kp[vc++]=void 0,e.notify()}vc=0,Yp=0}}function Gx(e,n){const s=typeof e=="function",r=e,i={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?lt.None:lt.Mutable,get(){return ms!==void 0&&Kx(i,ms,qc),i._snapshot},subscribe(o){const l=Z6(o),u={current:!1},d=eN(()=>{i.get(),u.current?l.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(o){const l=ms,u=n?.compare??Object.is;if(s)ms=i,++qc,i.depsTail=void 0;else if(o===void 0)return!1;s&&(i.flags=lt.Mutable|lt.RecursedCheck);try{const d=i._snapshot,p=typeof o=="function"?o(d):o===void 0&&s?r(d):o;return d===void 0||!u(d,p)?(i._snapshot=p,!0):!1}finally{ms=l,s&&(i.flags&=~lt.RecursedCheck),Gc(i)}}};return s?(i.flags=lt.Mutable|lt.Dirty,i.get=function(){const o=i.flags;if(o&lt.Dirty||o&lt.Pending&&Wj(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Yx(l)}}else o&lt.Pending&&(i.flags=o&~lt.Pending);return ms!==void 0&&Kx(i,ms,qc),i._snapshot}):i.set=function(o){if(i._update(o)){const l=i.subs;l!==void 0&&(J6(l),Yx(l),Hj())}},i}function eN(e){const n=()=>{const r=ms;ms=s,++qc,s.depsTail=void 0,s.flags=lt.Watching|lt.RecursedCheck;try{return e()}finally{ms=r,s.flags&=~lt.RecursedCheck,Gc(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:lt.Watching|lt.RecursedCheck,notify(){const r=this.flags;r&lt.Dirty||r&lt.Pending&&Wj(this.deps,this)?n():this.flags=lt.Watching},stop(){this.flags=lt.None,this.depsTail=void 0,Gc(this)}};return n(),s}var Gh={exports:{}},Qh={},Zh={exports:{}},Xh={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var Qx;function tN(){if(Qx)return Xh;Qx=1;var e=Bo();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var s=typeof Object.is=="function"?Object.is:n,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(m,x){var y=x(),j=r({inst:{value:y,getSnapshot:x}}),k=j[0].inst,b=j[1];return o(function(){k.value=y,k.getSnapshot=x,d(k)&&b({inst:k})},[m,y,x]),i(function(){return d(k)&&b({inst:k}),m(function(){d(k)&&b({inst:k})})},[m]),l(y),y}function d(m){var x=m.getSnapshot;m=m.value;try{var y=x();return!s(m,y)}catch{return!0}}function p(m,x){return x()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return Xh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Xh}var Zx;function nN(){return Zx||(Zx=1,Zh.exports=tN()),Zh.exports}/**
49
+ * @license React
50
+ * use-sync-external-store-shim/with-selector.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var Xx;function sN(){if(Xx)return Qh;Xx=1;var e=Bo(),n=nN();function s(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:s,i=n.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Qh.useSyncExternalStoreWithSelector=function(p,f,m,x,y){var j=o(null);if(j.current===null){var k={hasValue:!1,value:null};j.current=k}else k=j.current;j=u(function(){function S(E){if(!N){if(N=!0,$=E,E=x(E),y!==void 0&&k.hasValue){var M=k.value;if(y(M,E))return A=M}return A=E}if(M=A,r($,E))return M;var F=x(E);return y!==void 0&&y(M,F)?($=E,M):($=E,A=F)}var N=!1,$,A,R=m===void 0?null:m;return[function(){return S(f())},R===null?void 0:function(){return S(R())}]},[f,m,x,y]);var b=i(p,j[0],j[1]);return l(function(){k.hasValue=!0,k.value=b},[b]),d(b),b},Qh}var Jx;function rN(){return Jx||(Jx=1,Gh.exports=sN()),Gh.exports}var iN=rN();function aN(e,n){return e===n}function dn(e,n,s=aN){const r=C.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),i=C.useCallback(()=>e?.get(),[e]);return iN.useSyncExternalStoreWithSelector(r,i,i,n,s)}var oN={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Jr(e){const n=hn(),s=C.useContext(e.from?G6:Nu),r=e.from??s,i=r?e.from?n.stores.getRouteMatchStore(r):n.stores.matchStores.get(r):void 0,o=C.useRef(void 0);return dn(i??oN,l=>{if((e.shouldThrow??!0)&&!l&&Ls(),l===void 0)return;const u=e.select?e.select(l):l;if(e.structuralSharing??n.options.defaultStructuralSharing){const d=fr(o.current,u);return o.current=d,d}return u})}function Vj(e){return Jr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function Kj(e){const{select:n,...s}=e;return Jr({...s,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function Su(e){return Jr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const s=e.strict===!1?n.params:n._strictParams;return e.select?e.select(s):s}})}function ei(e){return Jr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Gt(e){const n=hn();return C.useCallback(s=>n.navigate({...s,from:s.from??e?.from}),[e?.from,n])}function Yj(e){return Jr({...e,select:n=>e.select?e.select(n.context):n.context})}var Cu=cj();function lN(e,n){const s=hn(),r=V5(n),{activeProps:i,inactiveProps:o,activeOptions:l,to:u,preload:d,preloadDelay:p,preloadIntentProximity:f,hashScrollIntoView:m,replace:x,startTransition:y,resetScroll:j,viewTransition:k,children:b,target:S,disabled:N,style:$,className:A,onClick:R,onBlur:E,onFocus:M,onMouseEnter:F,onMouseLeave:W,onTouchStart:I,ignoreBlocker:q,params:L,search:U,hash:_,state:G,mask:le,reloadDocument:V,unsafeRelative:Y,from:te,_fromLocation:P,...B}=e,J=Dj(),z=C.useMemo(()=>e,[s,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ye=dn(s.stores.location,Ge=>Ge,(Ge,ee)=>Ge.href===ee.href),fe=C.useMemo(()=>{const Ge={_fromLocation:ye,...z};return s.buildLocation(Ge)},[s,ye,z]),ve=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,Fe=fe.maskedLocation?fe.maskedLocation.external:fe.external,Ie=C.useMemo(()=>fN(ve,Fe,s.history,N),[N,Fe,ve,s.history]),Re=C.useMemo(()=>{if(Ie?.external)return Hc(Ie.href,s.protocolAllowlist)?void 0:Ie.href;if(!mN(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Hc(u,s.protocolAllowlist)?void 0:u}catch{}},[u,Ie,s.protocolAllowlist]),Je=C.useMemo(()=>{if(Re)return!1;if(l?.exact){if(!c6(ye.pathname,fe.pathname,s.basepath))return!1}else{const Ge=Vc(ye.pathname,s.basepath),ee=Vc(fe.pathname,s.basepath);if(!(Ge.startsWith(ee)&&(Ge.length===ee.length||Ge[ee.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Or(ye.search,fe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?J&&ye.hash===fe.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,ye,Re,J,fe.hash,fe.pathname,fe.search,s.basepath]),Ot=Je?pr(i,{})??cN:Jh,$n=Je?Jh:pr(o,{})??Jh,gt=[A,Ot.className,$n.className].filter(Boolean).join(" "),Zt=($||Ot.style||$n.style)&&{...$,...Ot.style,...$n.style},[Tn,En]=C.useState(!1),Vn=C.useRef(!1),Pt=e.reloadDocument||Re?!1:d??s.options.defaultPreload,mn=p??s.options.defaultPreloadDelay??0,Ct=C.useCallback(()=>{s.preloadRoute({...z,_builtLocation:fe}).catch(Ge=>{console.warn(Ge),console.warn(W6)})},[s,z,fe]);H5(r,C.useCallback(Ge=>{Ge?.isIntersecting&&Ct()},[Ct]),pN,{disabled:!!N||Pt!=="viewport"}),C.useEffect(()=>{Vn.current||!N&&Pt==="render"&&(Ct(),Vn.current=!0)},[N,Ct,Pt]);const An=Ge=>{const ee=Ge.currentTarget.getAttribute("target"),ue=S!==void 0?S:ee;if(!N&&!gN(Ge)&&!Ge.defaultPrevented&&(!ue||ue==="_self")&&Ge.button===0){Ge.preventDefault(),Cu.flushSync(()=>{En(!0)});const Te=s.subscribe("onResolved",()=>{Te(),En(!1)});s.navigate({...z,replace:x,resetScroll:j,hashScrollIntoView:m,startTransition:y,viewTransition:k,ignoreBlocker:q})}};if(Re)return{...B,ref:r,href:Re,...b&&{children:b},...S&&{target:S},...N&&{disabled:N},...$&&{style:$},...A&&{className:A},...R&&{onClick:R},...E&&{onBlur:E},...M&&{onFocus:M},...F&&{onMouseEnter:F},...W&&{onMouseLeave:W},...I&&{onTouchStart:I}};const Pn=Ge=>{if(N||Pt!=="intent")return;if(!mn){Ct();return}const ee=Ge.currentTarget;if(Za.has(ee))return;const ue=setTimeout(()=>{Za.delete(ee),Ct()},mn);Za.set(ee,ue)},Hs=Ge=>{N||Pt!=="intent"||Ct()},ls=Ge=>{if(N||!Pt||!mn)return;const ee=Ge.currentTarget,ue=Za.get(ee);ue&&(clearTimeout(ue),Za.delete(ee))};return{...B,...Ot,...$n,href:Ie?.href,ref:r,onClick:Ii([R,An]),onBlur:Ii([E,ls]),onFocus:Ii([M,Pn]),onMouseEnter:Ii([F,Pn]),onMouseLeave:Ii([W,ls]),onTouchStart:Ii([I,Hs]),disabled:!!N,target:S,...Zt&&{style:Zt},...gt&&{className:gt},...N&&uN,...Je&&dN,...J&&Tn&&hN}}var Jh={},cN={className:"active"},uN={role:"link","aria-disabled":!0},dN={"data-status":"active","aria-current":"page"},hN={"data-transitioning":"transitioning"},Za=new WeakMap,pN={rootMargin:"100px"},Ii=e=>n=>{for(const s of e)if(s){if(n.defaultPrevented)return;s(n)}};function fN(e,n,s,r){if(!r)return n?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function mN(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Ce=C.forwardRef((e,n)=>{const{_asChild:s,...r}=e,{type:i,...o}=lN(r,n),l=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!s){const{disabled:u,...d}=o;return C.createElement("a",d,l)}return C.createElement(s,o,l)});function gN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var xN=class extends _j{constructor(e){super(e),this.useMatch=n=>Jr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Yj({...n,from:this.id}),this.useSearch=n=>ei({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Su({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Kj({...n,from:this.id}),this.useLoaderData=n=>Vj({...n,from:this.id}),this.useNavigate=()=>Gt({from:this.fullPath}),this.Link=po.forwardRef((n,s)=>t.jsx(Ce,{ref:s,from:this.fullPath,...n}))}};function qt(e){return new xN(e)}var yN=class extends U6{constructor(e){super(e),this.useMatch=n=>Jr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Yj({...n,from:this.id}),this.useSearch=n=>ei({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Su({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Kj({...n,from:this.id}),this.useLoaderData=n=>Vj({...n,from:this.id}),this.useNavigate=()=>Gt({from:this.fullPath}),this.Link=po.forwardRef((n,s)=>t.jsx(Ce,{ref:s,from:this.fullPath,...n}))}};function jN(e){return new yN(e)}function kN(e){const n=hn(),s=`not-found-${dn(n.stores.location,r=>r.pathname)}-${dn(n.stores.status,r=>r)}`;return t.jsx(Gf,{getResetKey:()=>s,onCatch:(r,i)=>{if(Vt(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(Vt(r))return e.fallback?.(r);throw r},children:e.children})}function vN(){return t.jsx("p",{children:"Not Found"})}function qi(e){return t.jsx(t.Fragment,{children:e.children})}function Gj(e,n,s){return n.options.notFoundComponent?t.jsx(n.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?t.jsx(e.options.defaultNotFoundComponent,{...s}):t.jsx(vN,{})}function bN(e){return null}function wN(){return bN(hn()),null}var Qj=C.memo(function({matchId:n}){const s=hn(),r=s.stores.matchStores.get(n);r||Ls();const i=dn(s.stores.loadedAt,l=>l),o=dn(r,l=>l);return t.jsx(NN,{router:s,matchId:n,resetKey:i,matchState:C.useMemo(()=>{const l=o.routeId,u=s.routesById[l].parentRoute?.id;return{routeId:l,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:u}},[o._displayPending,o.routeId,o.ssr,s.routesById])})});function NN({router:e,matchId:n,resetKey:s,matchState:r}){const i=e.routesById[r.routeId],o=i.options.pendingComponent??e.options.defaultPendingComponent,l=o?t.jsx(o,{}):null,u=i.options.errorComponent??e.options.defaultErrorComponent,d=i.options.onCatch??e.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||f)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||f))?C.Suspense:qi,x=u?Gf:qi,y=p?kN:qi;return t.jsxs(i.isRoot?i.options.shellComponent??qi:qi,{children:[t.jsx(Nu.Provider,{value:n,children:t.jsx(m,{fallback:l,children:t.jsx(x,{getResetKey:()=>s,errorComponent:u||Qf,onCatch:(j,k)=>{if(Vt(j))throw j.routeId??=r.routeId,j;d?.(j,k)},children:t.jsx(y,{fallback:j=>{if(j.routeId??=r.routeId,!p||j.routeId&&j.routeId!==r.routeId||!j.routeId&&!i.isRoot)throw j;return C.createElement(p,j)},children:f||r._displayPending?t.jsx(K6,{fallback:l,children:t.jsx(ey,{matchId:n})}):t.jsx(ey,{matchId:n})})})})}),r.parentRouteId===_r?t.jsxs(t.Fragment,{children:[t.jsx(SN,{resetKey:s}),e.options.scrollRestoration&&Cj?t.jsx(wN,{}):null]}):null]})}function SN({resetKey:e}){const n=hn(),s=C.useRef(void 0);return ro(()=>{const r=n.latestLocation.href;(s.current===void 0||s.current!==r)&&(n.emit({type:"onRendered",..._i(n.stores.location.get(),n.stores.resolvedLocation.get())}),s.current=r)},[n.latestLocation.state.__TSR_key,e,n]),null}var ey=C.memo(function({matchId:n}){const s=hn(),r=(f,m)=>s.getMatch(f.id)?._nonReactive[m]??f._nonReactive[m],i=s.stores.matchStores.get(n);i||Ls();const o=dn(i,f=>f),l=o.routeId,u=s.routesById[l],d=C.useMemo(()=>{const f=(s.routesById[l].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:l,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return f?JSON.stringify(f):void 0},[l,o.loaderDeps,o._strictParams,o._strictSearch,s.options.defaultRemountDeps,s.routesById]),p=C.useMemo(()=>{const f=u.options.component??s.options.defaultComponent;return f?t.jsx(f,{},d):t.jsx(Qp,{})},[d,u.options.component,s.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const f=u.options.pendingMinMs??s.options.defaultPendingMinMs;if(f){const m=s.getMatch(o.id);if(m&&!m._nonReactive.minPendingPromise){const x=Ui();m._nonReactive.minPendingPromise=x,setTimeout(()=>{x.resolve(),m._nonReactive.minPendingPromise=void 0},f)}}throw r(o,"loadPromise")}if(o.status==="notFound")return Vt(o.error)||Ls(),Gj(s,u,o.error);if(o.status==="redirected")throw un(o.error)||Ls(),r(o,"loadPromise");if(o.status==="error")throw o.error;return p}),Qp=C.memo(function(){const n=hn(),s=C.useContext(Nu);let r,i=!1,o;{const p=s?n.stores.matchStores.get(s):void 0;[r,i]=dn(p,f=>[f?.routeId,f?.globalNotFound??!1]),o=dn(n.stores.matchesId,f=>f[f.findIndex(m=>m===s)+1])}const l=r?n.routesById[r]:void 0,u=n.options.defaultPendingComponent?t.jsx(n.options.defaultPendingComponent,{}):null;if(i)return l||Ls(),Gj(n,l,void 0);if(!o)return null;const d=t.jsx(Qj,{matchId:o});return r===_r?t.jsx(C.Suspense,{fallback:u,children:d}):d});function CN(){const e=hn(),n=C.useRef({router:e,mounted:!1}),[s,r]=C.useState(!1),i=dn(e.stores.isLoading,m=>m),o=dn(e.stores.hasPending,m=>m),l=Bh(i),u=i||s||o,d=Bh(u),p=i||o,f=Bh(p);return e.startTransition=m=>{r(!0),C.startTransition(()=>{m(),r(!1)})},C.useEffect(()=>{const m=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return zs(e.latestLocation.publicHref)!==zs(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{m()}},[e,e.history]),ro(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(x){console.error(x)}})()},[e]),ro(()=>{l&&!i&&e.emit({type:"onLoad",..._i(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),ro(()=>{f&&!p&&e.emit({type:"onBeforeRouteMount",..._i(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,f,e]),ro(()=>{if(d&&!u){const m=_i(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),Uj(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),m.hrefChanged&&H6(e)}},[u,d,e]),null}function $N(){const e=hn(),n=e.routesById[_r].options.pendingComponent??e.options.defaultPendingComponent,s=n?t.jsx(n,{}):null,r=t.jsxs(typeof document<"u"&&e.ssr?qi:C.Suspense,{fallback:s,children:[t.jsx(CN,{}),t.jsx(TN,{})]});return e.options.InnerWrap?t.jsx(e.options.InnerWrap,{children:r}):r}function TN(){const e=hn(),n=dn(e.stores.firstId,i=>i),s=dn(e.stores.loadedAt,i=>i),r=n?t.jsx(Qj,{matchId:n}):null;return t.jsx(Nu.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?r:t.jsx(Gf,{getResetKey:()=>s,errorComponent:Qf,onCatch:void 0,children:r})})}var EN=e=>({createMutableStore:Gx,createReadonlyStore:Gx,batch:Uj}),AN=e=>new PN(e),PN=class extends L6{constructor(e){super(e,EN)}};function RN({router:e,children:n,...s}){Tj(s)&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const r=t.jsx(Bj.Provider,{value:e,children:n});return e.options.Wrap?t.jsx(e.options.Wrap,{children:r}):r}function IN({router:e,...n}){return t.jsx(RN,{router:e,...n,children:t.jsx($N,{})})}function Qc(e){const n=hn({warn:e?.router===void 0}),s=e?.router||n,r=C.useRef(void 0);return dn(s.stores.__store,i=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const o=fr(r.current,e.select(i));return r.current=o,o}return e.select(i)}return i})}let vo="up",Zc=0,Zj=!1;const Xc=new Set;function Zf(e){if(e!==vo){vo=e;for(const n of Xc)n()}}function FN(e){Zc=0,Zf(e===401?"link-old":"up")}function Xj(){Zc+=1,Zc>=2&&Zf("down")}function zN(){Zc=0,vo==="down"&&Zf("up")}function Di(e){Zj=e;for(const n of Xc)n()}function LN(){return Zj&&vo==="down"?"up":vo}function MN(e){return Xc.add(e),()=>Xc.delete(e)}const Jc="squad.console.token";let eu=null;function ty(e){try{return e().getItem(Jc)}catch{return null}}function ta(){return eu??ty(()=>localStorage)??ty(()=>sessionStorage)}function qN(e){eu=e;try{localStorage.setItem(Jc,e)}catch{}}function Jj(e){eu===e&&(eu=null);for(const n of[()=>localStorage,()=>sessionStorage])try{n().getItem(Jc)===e&&n().removeItem(Jc)}catch{}}const wt=(()=>{const e=/^\/p\/([^/]+)/.exec(window.location.pathname);return e?decodeURIComponent(e[1]):null})(),Hi=wt?`/p/${encodeURIComponent(wt)}`:"";function Uo(e){return!Hi||!e.startsWith("/api/")||e.startsWith("/api/v1/app/")?e:Hi+e}function ON(){const e=new URL(window.location.href),n=e.searchParams.get("t");return n?(qN(n),e.searchParams.delete("t"),window.history.replaceState({},"",e.toString()),n):ta()}class bo extends Error{constructor(){super("This page's link is out of date. Run squad in a terminal: it opens the board with a fresh link."),this.name="UnauthorizedError"}}class $u extends Error{constructor(n,s){super(n),this.status=s,this.name="ApiError"}}function ek(e){return e instanceof Error&&(e.message===Xf||e instanceof $u&&e.status>=500)}const Xf="squad-kit did not answer, so this may not have gone through. Check that it still runs in its terminal, then try again.";async function tk(e,n){let s;try{s=await fetch(e,n)}catch{throw Xj(),new Error(Xf)}return FN(s.status),s}async function Se(e,n){const s=ta();if(!s)throw new bo;const r=await tk(Uo(e),{...n,headers:{"content-type":"application/json",authorization:`Bearer ${s}`}});if(r.status===401)throw Jj(s),new bo;if(!r.ok){const i=await _N(r);throw new Error(`${r.status} ${r.statusText}: ${i}`)}return await r.json()}async function _N(e){try{return(await e.text()).slice(0,400)}catch{return""}}async function at(e,n,s={}){const r=ta();if(!r)throw new bo;const i=await tk(Uo(e),{method:n,headers:{"content-type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify(s)});if(i.status===401)throw Jj(r),new bo;const o=await i.json().catch(()=>({}));if(!i.ok)throw new $u(o.error??`${i.status} ${i.statusText}`,i.status);return o}function wn(e,n){const s=ta()??"";return`${Uo(`/api/v1/tickets/${encodeURIComponent(e)}/file`)}?path=${encodeURIComponent(n.replace(/^file:\/\//,""))}&t=${encodeURIComponent(s)}`}function ss(e){const n=ta()??"";return`${Uo(e)}?t=${encodeURIComponent(n)}`}/**
57
+ * @license lucide-react v0.460.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const DN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nk=(...e)=>e.filter((n,s,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===s).join(" ").trim();/**
62
+ * @license lucide-react v0.460.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */var BN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
67
+ * @license lucide-react v0.460.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const WN=C.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...u},d)=>C.createElement("svg",{ref:d,...BN,width:n,height:n,stroke:e,strokeWidth:r?Number(s)*24/Number(n):s,className:nk("lucide",i),...u},[...l.map(([p,f])=>C.createElement(p,f)),...Array.isArray(o)?o:[o]]));/**
72
+ * @license lucide-react v0.460.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const oe=(e,n)=>{const s=C.forwardRef(({className:r,...i},o)=>C.createElement(WN,{ref:o,iconNode:n,className:nk(`lucide-${DN(e)}`,r),...i}));return s.displayName=`${e}`,s};/**
77
+ * @license lucide-react v0.460.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const sk=oe("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
82
+ * @license lucide-react v0.460.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const tu=oe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
87
+ * @license lucide-react v0.460.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const UN=oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
92
+ * @license lucide-react v0.460.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const rk=oe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
97
+ * @license lucide-react v0.460.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const nu=oe("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
102
+ * @license lucide-react v0.460.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Vi=oe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
107
+ * @license lucide-react v0.460.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const js=oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
112
+ * @license lucide-react v0.460.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Zp=oe("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
117
+ * @license lucide-react v0.460.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const ik=oe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
122
+ * @license lucide-react v0.460.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const Os=oe("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
127
+ * @license lucide-react v0.460.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const ge=oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
132
+ * @license lucide-react v0.460.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Jf=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
137
+ * @license lucide-react v0.460.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const ak=oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
142
+ * @license lucide-react v0.460.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Tu=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
147
+ * @license lucide-react v0.460.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const ok=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
152
+ * @license lucide-react v0.460.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const HN=oe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
157
+ * @license lucide-react v0.460.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const jr=oe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
162
+ * @license lucide-react v0.460.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const VN=oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
167
+ * @license lucide-react v0.460.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const lk=oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
172
+ * @license lucide-react v0.460.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const KN=oe("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
177
+ * @license lucide-react v0.460.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const Ho=oe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
182
+ * @license lucide-react v0.460.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const em=oe("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
187
+ * @license lucide-react v0.460.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const os=oe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
192
+ * @license lucide-react v0.460.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const YN=oe("CornerLeftUp",[["polyline",{points:"14 9 9 4 4 9",key:"m9oyvo"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);/**
197
+ * @license lucide-react v0.460.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const ks=oe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
202
+ * @license lucide-react v0.460.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const ck=oe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
207
+ * @license lucide-react v0.460.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const xs=oe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
212
+ * @license lucide-react v0.460.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const uk=oe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
217
+ * @license lucide-react v0.460.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const tm=oe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
222
+ * @license lucide-react v0.460.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const Eu=oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
227
+ * @license lucide-react v0.460.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const GN=oe("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
232
+ * @license lucide-react v0.460.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const QN=oe("FolderCheck",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]]);/**
237
+ * @license lucide-react v0.460.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const ZN=oe("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
242
+ * @license lucide-react v0.460.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const nm=oe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
247
+ * @license lucide-react v0.460.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const Xp=oe("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
252
+ * @license lucide-react v0.460.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const XN=oe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
257
+ * @license lucide-react v0.460.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const Jp=oe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
262
+ * @license lucide-react v0.460.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const dk=oe("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
267
+ * @license lucide-react v0.460.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const JN=oe("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
272
+ * @license lucide-react v0.460.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const e8=oe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
277
+ * @license lucide-react v0.460.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const t8=oe("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
282
+ * @license lucide-react v0.460.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const ef=oe("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
287
+ * @license lucide-react v0.460.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const n8=oe("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
292
+ * @license lucide-react v0.460.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const s8=oe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
297
+ * @license lucide-react v0.460.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const r8=oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
302
+ * @license lucide-react v0.460.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const hk=oe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
307
+ * @license lucide-react v0.460.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const sm=oe("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
312
+ * @license lucide-react v0.460.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const i8=oe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
317
+ * @license lucide-react v0.460.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const pk=oe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
322
+ * @license lucide-react v0.460.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const a8=oe("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
327
+ * @license lucide-react v0.460.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const fk=oe("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
332
+ * @license lucide-react v0.460.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const pn=oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
337
+ * @license lucide-react v0.460.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const mk=oe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
342
+ * @license lucide-react v0.460.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const o8=oe("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
347
+ * @license lucide-react v0.460.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const Au=oe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
352
+ * @license lucide-react v0.460.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const l8=oe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
357
+ * @license lucide-react v0.460.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const Bn=oe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
362
+ * @license lucide-react v0.460.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const ny=oe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
367
+ * @license lucide-react v0.460.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const Ki=oe("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
372
+ * @license lucide-react v0.460.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const sy=oe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
377
+ * @license lucide-react v0.460.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const gk=oe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
382
+ * @license lucide-react v0.460.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const Vo=oe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
387
+ * @license lucide-react v0.460.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const c8=oe("MonitorOff",[["path",{d:"M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2",key:"k0q8oc"}],["path",{d:"M22 15V5a2 2 0 0 0-2-2H9",key:"cp1ac0"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
392
+ * @license lucide-react v0.460.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const Ko=oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
397
+ * @license lucide-react v0.460.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const u8=oe("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
402
+ * @license lucide-react v0.460.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const su=oe("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
407
+ * @license lucide-react v0.460.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const Pu=oe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
412
+ * @license lucide-react v0.460.0 - ISC
413
+ *
414
+ * This source code is licensed under the ISC license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const wo=oe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
417
+ * @license lucide-react v0.460.0 - ISC
418
+ *
419
+ * This source code is licensed under the ISC license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const vs=oe("PencilLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]]);/**
422
+ * @license lucide-react v0.460.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const ru=oe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
427
+ * @license lucide-react v0.460.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const Sn=oe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
432
+ * @license lucide-react v0.460.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const d8=oe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
437
+ * @license lucide-react v0.460.0 - ISC
438
+ *
439
+ * This source code is licensed under the ISC license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const Nt=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
442
+ * @license lucide-react v0.460.0 - ISC
443
+ *
444
+ * This source code is licensed under the ISC license.
445
+ * See the LICENSE file in the root directory of this source tree.
446
+ */const Vr=oe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
447
+ * @license lucide-react v0.460.0 - ISC
448
+ *
449
+ * This source code is licensed under the ISC license.
450
+ * See the LICENSE file in the root directory of this source tree.
451
+ */const h8=oe("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
452
+ * @license lucide-react v0.460.0 - ISC
453
+ *
454
+ * This source code is licensed under the ISC license.
455
+ * See the LICENSE file in the root directory of this source tree.
456
+ */const io=oe("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
457
+ * @license lucide-react v0.460.0 - ISC
458
+ *
459
+ * This source code is licensed under the ISC license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */const Kr=oe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
462
+ * @license lucide-react v0.460.0 - ISC
463
+ *
464
+ * This source code is licensed under the ISC license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */const ti=oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
467
+ * @license lucide-react v0.460.0 - ISC
468
+ *
469
+ * This source code is licensed under the ISC license.
470
+ * See the LICENSE file in the root directory of this source tree.
471
+ */const ws=oe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
472
+ * @license lucide-react v0.460.0 - ISC
473
+ *
474
+ * This source code is licensed under the ISC license.
475
+ * See the LICENSE file in the root directory of this source tree.
476
+ */const p8=oe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
477
+ * @license lucide-react v0.460.0 - ISC
478
+ *
479
+ * This source code is licensed under the ISC license.
480
+ * See the LICENSE file in the root directory of this source tree.
481
+ */const f8=oe("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
482
+ * @license lucide-react v0.460.0 - ISC
483
+ *
484
+ * This source code is licensed under the ISC license.
485
+ * See the LICENSE file in the root directory of this source tree.
486
+ */const rm=oe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
487
+ * @license lucide-react v0.460.0 - ISC
488
+ *
489
+ * This source code is licensed under the ISC license.
490
+ * See the LICENSE file in the root directory of this source tree.
491
+ */const iu=oe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
492
+ * @license lucide-react v0.460.0 - ISC
493
+ *
494
+ * This source code is licensed under the ISC license.
495
+ * See the LICENSE file in the root directory of this source tree.
496
+ */const ry=oe("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
497
+ * @license lucide-react v0.460.0 - ISC
498
+ *
499
+ * This source code is licensed under the ISC license.
500
+ * See the LICENSE file in the root directory of this source tree.
501
+ */const Oc=oe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
502
+ * @license lucide-react v0.460.0 - ISC
503
+ *
504
+ * This source code is licensed under the ISC license.
505
+ * See the LICENSE file in the root directory of this source tree.
506
+ */const im=oe("SquareCheck",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
507
+ * @license lucide-react v0.460.0 - ISC
508
+ *
509
+ * This source code is licensed under the ISC license.
510
+ * See the LICENSE file in the root directory of this source tree.
511
+ */const iy=oe("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
512
+ * @license lucide-react v0.460.0 - ISC
513
+ *
514
+ * This source code is licensed under the ISC license.
515
+ * See the LICENSE file in the root directory of this source tree.
516
+ */const is=oe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
517
+ * @license lucide-react v0.460.0 - ISC
518
+ *
519
+ * This source code is licensed under the ISC license.
520
+ * See the LICENSE file in the root directory of this source tree.
521
+ */const Yo=oe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
522
+ * @license lucide-react v0.460.0 - ISC
523
+ *
524
+ * This source code is licensed under the ISC license.
525
+ * See the LICENSE file in the root directory of this source tree.
526
+ */const No=oe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
527
+ * @license lucide-react v0.460.0 - ISC
528
+ *
529
+ * This source code is licensed under the ISC license.
530
+ * See the LICENSE file in the root directory of this source tree.
531
+ */const Cn=oe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
532
+ * @license lucide-react v0.460.0 - ISC
533
+ *
534
+ * This source code is licensed under the ISC license.
535
+ * See the LICENSE file in the root directory of this source tree.
536
+ */const kr=oe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
537
+ * @license lucide-react v0.460.0 - ISC
538
+ *
539
+ * This source code is licensed under the ISC license.
540
+ * See the LICENSE file in the root directory of this source tree.
541
+ */const m8=oe("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/**
542
+ * @license lucide-react v0.460.0 - ISC
543
+ *
544
+ * This source code is licensed under the ISC license.
545
+ * See the LICENSE file in the root directory of this source tree.
546
+ */const xk=oe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
547
+ * @license lucide-react v0.460.0 - ISC
548
+ *
549
+ * This source code is licensed under the ISC license.
550
+ * See the LICENSE file in the root directory of this source tree.
551
+ */const g8=oe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
552
+ * @license lucide-react v0.460.0 - ISC
553
+ *
554
+ * This source code is licensed under the ISC license.
555
+ * See the LICENSE file in the root directory of this source tree.
556
+ */const am=oe("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
557
+ * @license lucide-react v0.460.0 - ISC
558
+ *
559
+ * This source code is licensed under the ISC license.
560
+ * See the LICENSE file in the root directory of this source tree.
561
+ */const x8=oe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
562
+ * @license lucide-react v0.460.0 - ISC
563
+ *
564
+ * This source code is licensed under the ISC license.
565
+ * See the LICENSE file in the root directory of this source tree.
566
+ */const y8=oe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
567
+ * @license lucide-react v0.460.0 - ISC
568
+ *
569
+ * This source code is licensed under the ISC license.
570
+ * See the LICENSE file in the root directory of this source tree.
571
+ */const yk=oe("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
572
+ * @license lucide-react v0.460.0 - ISC
573
+ *
574
+ * This source code is licensed under the ISC license.
575
+ * See the LICENSE file in the root directory of this source tree.
576
+ */const tf=oe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
577
+ * @license lucide-react v0.460.0 - ISC
578
+ *
579
+ * This source code is licensed under the ISC license.
580
+ * See the LICENSE file in the root directory of this source tree.
581
+ */const Qe=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function j8(e){return e==="err"?null:3200}function k8(e,n){return n.kind==="err"&&e.some(s=>s.kind==="err"&&s.text===n.text)?e:[...e,n]}let jk=null;const nf=new Set;function ay(e){jk=e;for(const n of nf)n()}const Go={open:(e={})=>ay(e),close:()=>ay(null)};function v8(){return C.useSyncExternalStore(e=>(nf.add(e),()=>nf.delete(e)),()=>jk)}const kk=C.createContext(null);function _c(e){try{return localStorage.getItem(e)}catch{return null}}function bc(e,n){try{localStorage.setItem(e,n)}catch{}}function vk(){const e=_c("sk.theme");return e==="light"||e==="dark"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function oy({children:e}){const[n,s]=C.useState(vk),[r,i]=C.useState(_c("sk.commands")!=="off"),[o,l]=C.useState(_c("sk.ticketFull")==="on"),[u,d]=C.useState(_c("sk.engineers")==="on"),[p,f]=C.useState([]);C.useEffect(()=>{document.documentElement.dataset.theme=n,bc("sk.theme",n)},[n]);const m=C.useCallback(j=>f(k=>k.filter(b=>b.id!==j)),[]),x=C.useCallback((j,k="ok",b)=>{const S=Date.now()+Math.random();f($=>k8($,{id:S,text:j,kind:k,...b?{retry:b}:{}}));const N=j8(k);N!==null&&setTimeout(()=>m(S),N)},[m]),y=C.useMemo(()=>({theme:n,toggleTheme:()=>s(j=>j==="light"?"dark":"light"),showCommands:r,toggleCommands:()=>i(j=>(bc("sk.commands",j?"off":"on"),!j)),ticketFull:o,toggleTicketFull:()=>l(j=>(bc("sk.ticketFull",j?"off":"on"),!j)),engineers:u,toggleEngineers:()=>d(j=>(bc("sk.engineers",j?"off":"on"),!j)),toast:x}),[n,r,o,u,x]);return t.jsxs(kk.Provider,{value:y,children:[e,t.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:p.map(j=>j.kind==="err"?t.jsxs("div",{className:"toast err",role:"alert",children:[t.jsx(jr,{size:16}),t.jsx("span",{className:"grow",children:j.text}),j.retry&&t.jsx("button",{className:"toast-act",onClick:()=>{m(j.id),j.retry()},children:"Try again"}),t.jsx("button",{className:"toast-act",onClick:()=>{m(j.id),Go.open()},children:"Report a problem"}),t.jsx("button",{className:"toast-x",onClick:()=>m(j.id),"aria-label":"Close this message",children:t.jsx(Qe,{size:15})})]},j.id):t.jsxs("div",{className:"toast",children:[t.jsx(ge,{size:16}),j.text]},j.id))})]})}function Le(){const e=C.useContext(kk);if(!e)throw new Error("usePrefs outside PrefsProvider");return e}function b8(e,n){return e instanceof bo?{text:e.message,home:!1}:e instanceof Error&&e.message===Xf?{text:`squad-kit did not answer, so ${n} could not load. Check that it still runs in its terminal, then press Try again.`,home:!1}:e instanceof Error&&/^404\b/.test(e.message)?{text:`${n[0].toUpperCase()}${n.slice(1)} could not load: this project is not open in squad-kit now. Add it again from Home.`,home:!0}:{text:`${n[0].toUpperCase()}${n.slice(1)} could not load. Nothing is lost. Press Try again.`,home:!1}}const sf="؀-ۿݐ-ݿࢠ-ࣿﭐ-﷿ﹰ-\uFEFF",w8=new RegExp(`[${sf}]`,"g"),N8=/[A-Za-z]/g;function ht(e){const n=String(e??"").replace(/```[\s\S]*?(```|$)/g," ").replace(/`[^`]*`/g," ").replace(/(https?:\/\/|file:\/\/)\S+/g," "),s=n.match(w8)?.length??0,r=n.match(N8)?.length??0,i=s+r;if(!i)return{lang:"none",dir:"ltr",share:0};const o=s/i;return{lang:o>=.85?"ar":o<=.15?"en":"mixed",dir:o>=.5?"rtl":"ltr",share:o}}function Bs(e){return e.dir==="rtl"?"t-ar":e.lang==="mixed"?"t-mx":"t-en"}function S8(e){const n=e.dir==="rtl"?"right to left":"left to right";return e.lang==="ar"?`Arabic · ${n}`:e.lang==="en"?`English · ${n}`:e.lang==="mixed"?`Mixed · ${n}`:""}const bk="[0-9\\u0660-\\u0669][0-9\\u0660-\\u0669.,:%/+\\-]*",ly="(?:[A-Za-z0-9._\\-/+#@:]*[A-Za-z0-9#+])?",C8=`(?:${bk}[  ]+)*[A-Za-z]${ly}(?:[  ]+[A-Za-z0-9]${ly})*`,$8=`[${sf}]+(?:[  ]+(?:${bk}[  ]+)*[${sf}]+)*`,T8=new RegExp(`(${C8})|(${$8})`,"g");function wk(e,n){const s=[];let r=0;const i=(o,l)=>{if(!o)return;const u=s.at(-1);u&&!u.dir&&!l?u.text+=o:s.push(l?{text:o,dir:l}:{text:o})};for(const o of e.matchAll(T8)){const l=o.index??0;i(e.slice(r,l));const u=!!o[1];i(o[0],u&&n==="rtl"?"ltr":!u&&n==="ltr"?"rtl":void 0),r=l+o[0].length}return i(e.slice(r)),s}function Nk(e){const n=e.filter(s=>s==="rtl").length;return e.length&&n*2>=e.length?"rtl":"ltr"}function De(e){const{dir:n}=ht(e);return{dir:n,lang:n==="rtl"?"ar":"en"}}function xe(e){return e.trim()?ht(e).dir:"auto"}function E8(e){return Nk(e.flat().map(ht).filter(n=>n.lang!=="none").map(n=>n.dir))}function as(e){return`⁨${e}⁩`}function A8(e,n){if(n<=0)return"";let s=0;for(const r of e.matchAll(/\S+/g))if(s+=1,s===n)return e.slice(0,(r.index??0)+r[0].length);return e}function P8(e){return e.match(/\S+/g)?.length??0}const Sk=new Set(["p","li","h1","h2","h3","h4","h5","h6","td","th","dt","dd","figcaption"]),om=new Set(["code","pre","svg","math"]);function Ck(e,n=!1){return e.type==="text"?e.value??"":e.tagName&&om.has(e.tagName)||n&&e.tagName&&(e.tagName==="ul"||e.tagName==="ol")?" ":(e.children??[]).map(s=>Ck(s,!0)).join("")}function R8(e,n){const s=e.properties??={},r=Array.isArray(s.className)?s.className:typeof s.className=="string"?[s.className]:[];s.className=[...r,n]}function lm(e,n,s){return{type:"element",tagName:e,properties:n,children:s}}function $k(e,n,s){if(!e.children||e.tagName&&om.has(e.tagName))return;const r=[];for(const i of e.children){if(i.type!=="text"){i.type==="element"&&!(i.tagName&&Sk.has(i.tagName))&&$k(i,n,s),r.push(i);continue}for(const o of wk(i.value??"",n)){const l=s?I8(o.text):[{type:"text",value:o.text}];o.dir?r.push(lm("bdi",{dir:o.dir},l)):r.push(...l)}}e.children=r}function I8(e){return e.split(/(\s+)/).filter(Boolean).map(n=>/^\s+$/.test(n)?{type:"text",value:n}:lm("span",{className:["fx"]},[{type:"text",value:n}]))}function F8(e,n={}){let s=null;const r=i=>{if(i.type==="element"&&i.tagName&&om.has(i.tagName)){i.tagName==="code"&&((i.properties??={}).dir="ltr"),i.tagName==="pre"&&(s=i);return}if(i.type==="element"&&i.tagName&&Sk.has(i.tagName)){const o=ht(Ck(i));if(o.lang!=="none"){const l=i.properties??={};l.dir=o.dir,l.lang=o.dir==="rtl"?"ar":"en",R8(i,Bs(o))}$k(i,o.dir,!!n.stream),s=i}for(const o of i.children??[])r(o);if(i.type==="element"&&(i.tagName==="ul"||i.tagName==="ol"||i.tagName==="table")){const o=[],l=u=>{for(const d of u.children??[]){if(d.type!=="element")continue;const p=d.tagName==="li"||d.tagName==="td"||d.tagName==="th";p&&d.properties?.dir&&o.push(d.properties.dir),(!p||i.tagName==="table")&&l(d)}};l(i),o.length&&((i.properties??={}).dir=Nk(o))}};return r(e),n.caret&&s&&s.tagName!=="pre"&&(s.children??=[]).push(lm("span",{className:["caret"],ariaHidden:"true"},[])),e}function cm(e={}){return n=>{F8(n,e)}}const Ms={analyst:"Analyst",architect:"Architect",spec:"Spec writer",builder:"Builder",tester:"Tester",reviewer:"Reviewer",release:"Release",triage:"Triage",you:"You",squad:"Squad"},z8={analyst:ti,architect:m8,spec:wo,builder:Ho,tester:im,reviewer:tm,release:js,triage:Os,you:x8,squad:y8};function ni({role:e,small:n,size:s}){const r=z8[e];return t.jsx("span",{className:`glyph ${n?"sm":""} ${e==="you"?"you":""}`,title:Ms[e],children:t.jsx(r,{size:s??(n?12:14),strokeWidth:2})})}function Kt({text:e,dir:n}){return t.jsx(t.Fragment,{children:wk(String(e??""),n).map((s,r)=>s.dir?t.jsx("bdi",{dir:s.dir,children:s.text},r):s.text)})}function D({text:e,lead:n,as:s="span",children:r,...i}){const{dir:o}=ht(e);return t.jsxs(s,{...i,dir:o,lang:o==="rtl"?"ar":"en",children:[n&&t.jsxs(t.Fragment,{children:[o==="rtl"?t.jsx("bdi",{dir:"ltr",children:n}):n," "]}),t.jsx(Kt,{text:e,dir:o}),r]})}function um({text:e,as:n="div",...s}){return t.jsx(n,{...s,children:e.trimEnd().split(`
582
+ `).map((r,i)=>r.trim()?t.jsx(D,{className:"wline",text:r},i):t.jsx("br",{},i))})}function Tk({path:e}){return ht(e).share?t.jsx(t.Fragment,{children:e.split(" › ").map((n,s)=>t.jsxs(C.Fragment,{children:[s>0&&" › ",t.jsx(D,{text:n})]},s))}):t.jsx(t.Fragment,{children:e})}function re({text:e,keep:n}){const{showCommands:s,toast:r}=Le();if(!s)return null;const i=()=>{navigator.clipboard?.writeText(e).then(()=>r("Command copied"),()=>r("Could not copy. Select the text instead.","err"))},o=n&&e.endsWith(n)&&e.length>n.length?e.length-n.length:0;return t.jsxs("span",{className:"term",dir:"ltr",title:"The same action in the terminal",children:[t.jsx("b",{children:">_"}),o?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:e.slice(0,o).trimEnd()}),t.jsx("span",{className:"term-keep",children:n})]}):t.jsx("span",{children:e}),t.jsx("button",{onClick:i,"aria-label":`Copy ${e}`,children:t.jsx(os,{size:13})})]})}const ep=[{stage:"tickets",name:"Tickets"},{stage:"specs",name:"Specs"},{stage:"implement",name:"Implement"},{stage:"test",name:"Test"},{stage:"review",name:"Review"},{stage:"release",name:"Release"}];function L8({ticket:e}){const n=e.stage==="bugs"?"tickets":e.stage,s=n==="done"?ep.length:ep.findIndex(o=>o.stage===n),r=e.waiting?"you":"work",i=new Map((e.now?.stages??[]).map(o=>[o.stage,o.note]));return t.jsx("div",{className:"track","aria-label":"Where this ticket is",children:ep.map((o,l)=>{const u=l<s?"done":l===s?`cur ${r}`:"",d=i.get(o.stage);return t.jsxs("div",{className:`ts ${u}`,children:[t.jsx("span",{className:"nd",children:l<s?t.jsx(ge,{size:12,strokeWidth:3}):null}),o.name,l===s&&t.jsx("span",{className:"tag",children:r==="you"?"Your turn":e.stage==="release"?"Ready":e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad?"Waiting":"Working"}),i.size>0&&t.jsx("span",{className:"tnote",children:l===s&&d==="your turn"?"":d??""})]},o.stage)})})}function He({title:e,onClose:n,children:s,footer:r,icon:i,wide:o,losing:l}){const[u,d]=C.useState(!1),p=C.useCallback(()=>l?d(!0):n(),[l,n]);return C.useEffect(()=>{const f=m=>m.key==="Escape"&&p();return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[p]),t.jsx("div",{className:"modal-veil",onMouseDown:f=>f.target===f.currentTarget&&p(),children:t.jsxs("div",{className:`modal ${o?"wide":""}`,role:"dialog","aria-modal":"true","aria-label":e,children:[t.jsxs("header",{children:[i,t.jsx(D,{as:"h3",text:e}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn",onClick:p,"aria-label":"Close",children:t.jsx(Qe,{size:16})})]}),t.jsx("div",{className:"mb",children:s}),u?t.jsxs("footer",{role:"alertdialog","aria-label":"Close this window?",children:[t.jsxs("span",{className:"grow",children:["Close and lose ",l,"? What you typed stays as a draft."]}),t.jsx("button",{className:"btn pri",autoFocus:!0,onClick:()=>d(!1),children:"Keep working"}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}):r&&t.jsx("footer",{children:r})]})})}function So({what:e,error:n,onRetry:s}){const r=b8(n,e);return t.jsx("div",{className:"center",children:t.jsxs("div",{role:"alert",children:[t.jsx("h2",{children:"This did not load"}),t.jsx("p",{children:r.text}),t.jsxs("p",{style:{marginTop:12,display:"flex",gap:8,justifyContent:"center"},children:[t.jsx("button",{className:"btn pri",onClick:s,children:"Try again"}),r.home&&t.jsx("a",{className:"btn",href:"/",children:"Go to Home"})]})]})})}function Ek({onClear:e}){return t.jsxs("span",{className:"note draftnote",children:["Kept as a draft on this computer."," ",t.jsx("button",{type:"button",className:"linkbtn",onClick:e,children:"Clear"})]})}function Wn(e){return new Date(e).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}function Ws(e){return e?new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short"}):""}function St(e){const n=Math.max(0,(Date.now()-Date.parse(e))/1e3);return n<60?"just now":n<3600?`${Math.round(n/60)} min ago`:n<86400?`${Math.round(n/3600)} h ago`:Ws(e)}function cy({text:e,dir:n}){const s=e.split(/(\*\*[^*]+\*\*)/g);return t.jsx(t.Fragment,{children:s.map((r,i)=>r.startsWith("**")?t.jsx("strong",{children:t.jsx(Kt,{text:r.slice(2,-2),dir:n})},i):t.jsx("span",{children:t.jsx(Kt,{text:r,dir:n})},i))})}function M8({notes:e}){return t.jsx("div",{className:"notes",children:e.split(`
583
+ `).map((n,s)=>{const{dir:r}=ht(n);return n.startsWith("### ")?t.jsx(D,{as:"h4",text:n.slice(4)},s):n.startsWith("- ")?t.jsxs("p",{dir:r,lang:r==="rtl"?"ar":"en",children:["• ",t.jsx(cy,{text:n.slice(2),dir:r})]},s):n.trim()?t.jsx("p",{dir:r,lang:r==="rtl"?"ar":"en",children:t.jsx(cy,{text:n,dir:r})},s):null})})}function dm(e){switch(e.waiting?.kind){case"questions":return`squad answer ${e.id}`;case"stuck":return`squad decide ${e.id}`;case"ask":return`squad reply ${e.id}`;case"yours":return e.takenOver?.free?`squad outside back ${e.id}`:`squad give-back ${e.id}`;case"chat":return`squad chat ${e.id}`;case"depends":return`squad build ${e.id} --on-branch`;case"change":case"spec":case"plan":case"proof":return`squad approve ${e.id}`;default:return`squad watch ${e.id}`}}function hm(e){const n=e.outdated??[];return n.length===1?`${n[0].adr} came after this plan and changes it`:`${n.map(s=>s.adr).join(" and ")} came after this plan and change it`}function au(e){switch(e.waiting?.kind){case"questions":return"Answer";case"spec":return"Review spec";case"plan":return e.specApproved?"Review design":"Review plan";case"proof":return"Check proof";case"stuck":return"Decide";case"ask":return"Answer";case"yours":return e.takenOver?.free?"Bring it back":"Give back";case"chat":return"Open chat";case"change":return"Review design update";case"depends":return"Choose";default:return"Open"}}const _s={tickets:"Tickets",specs:"Specs",implement:"Implement",test:"Test",review:"Review",release:"Release",bugs:"Bugs",done:"Released"},Ak=900;function Ke(){return $e({queryKey:["board"],queryFn:()=>Se("/api/v1/board"),refetchInterval:Ak})}function Qo(e){return $e({queryKey:["ticket",e],queryFn:()=>Se(`/api/v1/tickets/${e}`),enabled:!!e,refetchInterval:Ak})}function q8(){return $e({queryKey:["releases"],queryFn:()=>Se("/api/v1/releases"),refetchInterval:2e3})}function Pk(){return $e({queryKey:["apps"],queryFn:()=>Se("/api/v1/apps"),refetchInterval:e=>e.state.data?.apps.some(n=>n.state==="starting")||e.state.data?.reading?1e3:5e3})}function Rk(){return $e({queryKey:["app","settings"],queryFn:()=>Se("/api/v1/app/settings"),refetchInterval:5e3})}function O8(){return $e({queryKey:["architecture"],queryFn:()=>Se("/api/v1/architecture"),refetchInterval:2e3})}function pe(){const e=Hn(),{toast:n}=Le(),s=Sj({mutationFn:({path:r,body:i,method:o="POST"})=>at(r,o,i),onSuccess:(r,i)=>{e.invalidateQueries(),i.after?.(r);const o=typeof i.done=="function"?i.done(r):i.done;o&&n(o)},onError:(r,i)=>n(r instanceof Error?r.message:String(r),"err",ek(r)?()=>s.mutate(i):void 0)});return s}function Ik(){const{toast:e}=Le(),[n,s]=C.useState(!1);return{restarting:n,restart:async()=>{s(!0),Di(!0);const i=await fetch("/healthz").then(l=>l.json()).catch(()=>({startedAt:void 0}));try{await at("/api/v1/restart","POST")}catch(l){s(!1),Di(!1),e(l instanceof Error?l.message:String(l),"err");return}const o=Date.now()+9e4;for(;Date.now()<o;){await new Promise(u=>setTimeout(u,1e3));const l=await fetch("/healthz").then(u=>u.json()).catch(()=>null);if(l?.startedAt&&l.startedAt!==i.startedAt){window.location.reload();return}}s(!1),Di(!1),e("The board did not come back. Run squad console in your terminal.","err")}}}function _8(){const{restarting:e,restart:n}=Ik();return t.jsxs("div",{className:"updatebar",role:"status",children:[t.jsx(Vr,{size:15}),t.jsxs("span",{children:[t.jsx("b",{children:"squad-kit was updated."})," Restart the board to use the new version. Running work picks up where it stopped."]}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn sm pri",disabled:e,onClick:()=>void n(),children:e?"Restarting…":"Restart now"})]})}function D8(e,n){const s=e instanceof Error?e.message:String(e);return/^404\b/.test(s)?`There is no ticket ${n} on this board. It may have been deleted.`:/^409\b[^{]*\{"error":"(.*)"\}$/.exec(s)?.[1]??s}function B8(e,n=/win/i.test(typeof navigator>"u"?"":navigator.platform)&&!/darwin/i.test(navigator.platform)){return n||/^sudo\b/.test(e)?e:`sudo ${e}`}const Fk=["app","update"],Ru=["waiting","installing","restarting"],W8=2*6e4;function Iu(){const e=$e({queryKey:Fk,queryFn:()=>Se("/api/v1/app/update"),refetchInterval:r=>Ru.includes(r.state.data?.progress.state??"idle")?1e3:6e4}),n=C.useRef(null),s=e.data?.startedAt;return C.useEffect(()=>{s&&(n.current&&n.current!==s&&window.location.reload(),n.current??=s)},[s]),e}function Zo(){const e=Hn(),{toast:n}=Le(),[s,r]=C.useState(!1);return{pending:s,call:async(o,l,u={})=>{r(!0);try{const d=await at(o,l,u);return e.setQueryData(Fk,d),d}catch(d){return n(d instanceof Error?d.message:String(d),"err"),null}finally{r(!1)}}}}function rf(e=[]){const n=[...new Set(e.map(s=>s.ticket??`the Architect in ${s.project}`))];return n.length<=1?n[0]??"":n.length<=3?`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`:`${n.slice(0,2).join(", ")} and ${n.length-2} more`}function U8(e){const n=new Date(e),s=o=>o.toDateString(),r=new Date(Date.now()-864e5);return`${s(n)===s(new Date)?"Today":s(n)===s(r)?"Yesterday":n.toLocaleDateString("en-GB",{day:"numeric",month:"short"})} at ${Wn(e)}`}function pm({text:e}){const{toast:n}=Le(),s=()=>{const r=navigator.clipboard?.writeText(e);if(!r)return n("Could not copy. Select the text instead.","err");r.then(()=>n("Command copied"),()=>n("Could not copy. Select the text instead.","err"))};return t.jsxs("div",{className:"upd-cmd",children:[t.jsxs("span",{className:"term",children:[t.jsx("b",{children:">_"}),t.jsx("span",{children:e})]}),t.jsxs("button",{className:"btn sm",onClick:s,children:[t.jsx(os,{size:13})," Copy"]})]})}const H8=3;function zk({s:e}){const n=e.releases?.length?e.releases:e.notes?.length?[{version:e.latest??e.current,lines:e.notes,url:e.notesUrl}]:[];if(!n.length)return null;if(n.length===1)return t.jsx("ul",{className:"upd-notes","aria-label":"What is new",children:n[0].lines.slice(0,3).map(i=>t.jsx("li",{children:i},i))});const s=n.slice(0,H8),r=n.length-s.length;return t.jsxs("div",{className:"upd-rels","aria-label":"What is new",children:[s.map(i=>t.jsxs("div",{className:"upd-rel",children:[t.jsx("a",{className:"upd-ver",href:i.url,target:"_blank",rel:"noreferrer",title:`What is new in ${i.version}`,children:i.version}),t.jsx("ul",{className:"upd-notes",children:i.lines.slice(0,3).map(o=>t.jsx("li",{children:o},o))})]},i.version)),r>0&&t.jsxs("a",{className:"upd-more",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:["And ",r," older ",r===1?"release":"releases"]})]})}function V8(e){const n=e.progress.state;return Ru.includes(n)?`Updating to ${e.progress.to}`:n==="done"?`On ${e.current} now`:n==="failed"?"Update needs you":!e.newer||!e.latest||e.later===e.latest?null:`${e.latest} is ready`}function Lk(){const{data:e}=Iu();if(!e)return null;const n=e.progress.state;return Ru.includes(n)?t.jsx(Y8,{s:e}):n==="done"?t.jsx(G8,{s:e}):n==="failed"?t.jsx(Q8,{s:e}):!e.newer||!e.latest||e.later===e.latest?null:t.jsx(K8,{s:e})}function K8({s:e}){const{pending:n,call:s}=Zo(),r=e.devInstall||e.major;return t.jsxs("section",{className:"upd","aria-label":"A new squad-kit",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(js,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsxs("b",{className:"upd-title",children:["squad-kit ",e.latest," is ready"]}),t.jsx(zk,{s:e}),t.jsx("span",{className:"upd-sub",children:e.devInstall?"This squad-kit runs from its source folder, so it does not update itself. To use the new version, run:":e.major?`A big change from ${e.current}. Read what is new first, then run this in a terminal:`:`You have ${e.current}. Takes about a minute. Your tickets and work are kept.`}),r&&t.jsx(pm,{text:e.command})]}),t.jsxs("div",{className:"upd-acts",children:[!r&&t.jsxs("button",{className:"btn sm pri",disabled:n,onClick:()=>void s("/api/v1/app/update","POST"),children:[t.jsx(js,{size:14})," Update now"]}),(!(e.notes?.length||e.releases?.length)||r)&&t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"What is new"}),t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void s("/api/v1/app/update","PUT",{later:e.latest}),children:"Later"}),!r&&t.jsx(re,{text:"squad upgrade"})]})]})}function Y8({s:e}){const n=e.progress;C.useEffect(()=>{if(n.state!=="restarting")return;Di(!0);const p=window.setTimeout(()=>Di(!1),W8);return()=>{window.clearTimeout(p),Di(!1)}},[n.state]);const{pending:s,call:r}=Zo(),i=Ru.indexOf(n.state),o=p=>p<i?"done":p===i?"now":"todo",l=n.now?"Stopped the running steps":n.waitedFor?.length?`Waited for ${rf(n.waitedFor)} to finish ${n.waitedFor.length===1?"its step":"their steps"}`:"No work was in the middle of a step",u=n.busy?.length?`${rf(n.busy)} ${n.busy.length===1?"is":"are"} in the middle of a step`:"Almost there",d=[{label:i>0?l:"Waiting for running work to reach a safe point",note:i===0?u:n.now?"They pick up again after the restart":"Nothing was cut off"},{label:i>1?`Installed squad-kit ${n.to}`:`Installing squad-kit ${n.to}`,note:i===1?"Takes about a minute":i>1?"Done":"Next"},{label:"Restarting the app",note:i===2?"This page reloads on its own":"Same link, same tickets"},{label:"Picking up where each ticket was",note:"Nothing is lost"}];return t.jsxs("section",{className:"upd steps","aria-label":`Updating to squad-kit ${n.to}`,"aria-live":"polite",children:[t.jsxs("div",{className:"upd-head",children:[t.jsxs("b",{className:"upd-title",children:["Updating to squad-kit ",n.to]}),t.jsx("span",{className:"upd-sub",children:n.state==="waiting"?"squad-kit waits until no agent is in the middle of a step, so no work is cut off.":"Takes about a minute. Your tickets and work are kept."}),n.state==="waiting"&&t.jsxs("span",{className:"upd-acts",children:[t.jsx("button",{className:"btn sm pri",disabled:s,onClick:()=>void r("/api/v1/app/update","POST",{now:!0}),title:"Running steps stop now and pick up again after the restart",children:"Update now anyway"}),t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","DELETE"),children:"Not now"})]})]}),t.jsx("ol",{className:"setup-steps",children:d.map((p,f)=>t.jsxs("li",{className:o(f),children:[t.jsx("span",{className:"mark",children:o(f)==="done"?t.jsx(ge,{size:12,strokeWidth:3}):o(f)==="now"?t.jsx("span",{className:"live"}):null}),t.jsxs("span",{className:"txt",children:[t.jsx("b",{children:p.label}),t.jsx("small",{title:p.note,children:p.note})]})]},p.label))}),t.jsx("div",{className:"setup-bar","aria-hidden":!0,children:t.jsx("i",{})})]})}function G8({s:e}){const{pending:n,call:s}=Zo(),r=e.progress.carried??[];return t.jsxs("section",{className:"upd","aria-label":`You are on squad-kit ${e.current}`,children:[t.jsx("span",{className:"upd-ic ok",children:t.jsx(ge,{size:16,strokeWidth:2.6})}),t.jsxs("div",{className:"upd-main",children:[t.jsxs("b",{className:"upd-title",children:["You are on squad-kit ",e.current]}),t.jsx("span",{className:"upd-sub",children:r.length?`${rf(r)} carried on where ${r.length===1?"it was":"they were"}. Nothing was lost.`:"Your tickets and work are kept."}),t.jsx(zk,{s:e})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"Read what is new"}),t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void s("/api/v1/app/update","DELETE"),children:"Close"})]})]})}function Q8({s:e}){const n=e.progress,{pending:s,call:r}=Zo();return t.jsxs("section",{className:"upd failed",role:"alert","aria-label":"squad-kit could not update by itself",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(r8,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:"Could not update by itself"}),t.jsxs("span",{className:"upd-sub",children:[n.reason," ",n.permission?"Run this once in a terminal, then press Restart:":"Try again, or run this in a terminal, then press Restart:"]}),t.jsx(pm,{text:n.permission?B8(e.command):e.command}),n.output&&t.jsxs("details",{className:"upd-out",children:[t.jsx("summary",{children:"What the installer said"}),t.jsx("pre",{children:n.output})]})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsxs("button",{className:"btn sm pri",disabled:s,onClick:()=>void r("/api/v1/app/update/restart","POST"),children:[t.jsx(Vr,{size:14})," Restart"]}),!n.permission&&t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","POST"),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","DELETE"),children:"Not now"})]})]})}function Mk(){const{data:e}=Iu(),{pending:n,call:s}=Zo(),{toast:r}=Le();if(!e)return null;const i=async()=>{const l=await s("/api/v1/app/update/check","POST");l&&(l.checkError?r(l.checkError,"err"):r(l.newer?`squad-kit ${l.latest} is ready`:`You are on the latest version (${l.current})`))},o=e.newer&&!e.devInstall&&!e.major&&e.progress.state==="idle";return t.jsxs("div",{className:"about",children:[t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Version"}),t.jsxs("span",{className:"about-row",children:[t.jsx("b",{children:e.current}),e.newer?t.jsxs("span",{className:"pill you",children:[e.latest," is ready"]}):e.checkedAt&&!e.checkError?t.jsx("span",{className:"pill ok",children:"Up to date"}):null,e.devInstall&&t.jsx("span",{className:"pill",children:"Source folder"})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Last checked"}),t.jsxs("span",{className:"about-row",children:[e.checkedAt?U8(e.checkedAt):"Not yet",e.checkError&&t.jsx("span",{className:"note bad",children:e.checkError})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Updates"}),t.jsxs("span",{className:"about-row",children:[t.jsxs("label",{className:"about-daily",children:[t.jsx("input",{type:"checkbox",checked:e.daily,disabled:n,onChange:l=>void s("/api/v1/app/update","PUT",{daily:l.target.checked})}),"Check for updates every day"]}),t.jsx("span",{className:"note",children:"Turn it off on a network without internet."})]})]}),t.jsxs("div",{className:"about-acts",children:[t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void i(),children:n?"Checking…":"Check for updates"}),t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"Release notes"}),o&&t.jsxs("button",{className:"btn sm pri",disabled:n,onClick:()=>void s("/api/v1/app/update","POST"),children:[t.jsx(js,{size:14})," Update to ",e.latest]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad upgrade"})]}),e.newer&&(e.devInstall||e.major)&&t.jsx(pm,{text:e.command})]})}function Z8(){const{data:e}=Iu(),[n,s]=C.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm",onClick:()=>s(!0),title:"Version and updates",children:[e?`squad-kit ${e.current}`:"About",e?.newer&&t.jsx("span",{className:"about-dot","aria-label":`${e.latest} is ready`})]}),n&&t.jsx(He,{title:"About squad-kit",onClose:()=>s(!1),children:t.jsx(Mk,{})})]})}const qk="squad-kit-first-start-lang";function fm(){try{const e=localStorage.getItem(qk);if(e==="ar"||e==="en")return e}catch{}return typeof navigator<"u"&&navigator.language?.toLowerCase().startsWith("ar")?"ar":"en"}function X8(e){try{localStorage.setItem(qk,e)}catch{}}function Ok(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function _k(e){try{localStorage.setItem(e,"1")}catch{}}const Dk=e=>!!e.mergedAt||e.stage==="release"||e.stage==="done";function J8(e,n){return[...e,...n].some(Dk)?null:e.find(s=>s.track!=="auto"&&!s.takenOver?.free)??null}function e7(e){const n=e.waiting?.kind;return n==="proof"?3:n==="spec"||n==="plan"?1:e.stage==="tickets"||n==="questions"?0:e.stage==="specs"?1:2}function t7(e){const n=e.waiting?.kind;return n?n==="questions"?"questions":n==="spec"||n==="plan"||n==="proof"?n:"other":"working"}const n7=1440*60*1e3;function s7(e,n,s=Date.now()){const r=[...e,...n].filter(Dk);if(r.length!==1)return null;const i=r[0],o=Date.parse(i.mergedAt??"");return o&&s-o<n7?i:null}function tp(e,n,s,r){return e===1?n:e===2?s:`${e} ${e<=10?r:n}`}function r7(e){const n=Date.parse(e.createdAt),s=Date.parse(e.mergedAt??""),r=n&&s?Math.max(1,Math.round((s-n)/6e4)):1,i=e.gates?.proof==="pass"?e.criteria?.length:void 0,o=(e.gates?.ran??[]).reduce((u,d)=>u+(d.ok?d.tests??0:0),0),l=(e.usage??[]).reduce((u,d)=>u+(d.costUsd??0),0);return{minutes:r,...i?{doneWhen:i}:{},...o?{tests:o}:{},...l?{costUsd:l}:{}}}const i7={en:{title:"Your first story",hide:"Hide this",open:"Open it",items:["Answer the Analyst","Approve what gets built","Your squad builds it","Check the proof and say Looks right"],hints:{questions:{head:"Your turn: answer the questions",body:"The Analyst asks only what your story leaves open. Your answers shape the story."},spec:{head:"Your turn: approve the spec",body:"This is what the squad will build, in plain words. Nothing is built until you approve it."},plan:{head:"Your turn: approve the plan",body:"This is how the squad will build it. Nothing is built until you approve it."},proof:{head:"Your turn: check the proof",body:'Each "done when" shows pictures of the real app. Look at them, or press Try it yourself to use it. Nothing is merged until you say so.'},other:{head:"Your turn",body:"The squad needs a word from you. Open the story to see what."},working:{head:"Your squad is working",body:"You can close this and come back. You get a card when the squad needs you, and you can ask a question at any time."}}},ar:{title:"قصتك الأولى",hide:"إخفاء",open:"افتحها",items:["أجب عن أسئلة المحلل","وافق على ما سيُبنى","فريقك يبنيها","راجع الدليل وقل: يبدو صحيحًا"],hints:{questions:{head:"دورك: أجب عن الأسئلة",body:"لا يسأل المحلل إلا عمّا تركته قصتك مفتوحًا، وإجاباتك تحدد شكلها."},spec:{head:"دورك: وافق على المواصفات",body:"هذا ما سيبنيه الفريق بكلمات واضحة، ولن يُبنى شيء حتى توافق."},plan:{head:"دورك: وافق على الخطة",body:"هكذا سيبنيه الفريق، ولن يُبنى شيء حتى توافق."},proof:{head:"دورك: راجع الدليل",body:"كل شرط إنجاز يعرض صورًا من التطبيق الحقيقي. انظر إليها، أو جرّب التطبيق بنفسك. لا يُدمج شيء حتى تقول ذلك."},other:{head:"دورك",body:"يحتاج الفريق إلى كلمة منك. افتح القصة لتعرف ما هي."},working:{head:"فريقك يعمل",body:"يمكنك إغلاق هذا والعودة لاحقًا. ستصلك بطاقة عندما يحتاجك الفريق، ويمكنك طرح سؤال في أي وقت."}}}};function a7({tickets:e,archived:n,live:s,project:r,onOpen:i}){const o=`squad-kit-first-story-hidden:${r}`,[l,u]=C.useState(()=>Ok(o)),d=fm(),p=s&&!l?J8(e,n):null;if(!p)return null;const f=i7[d],m=e7(p),x=t7(p),y=f.hints[x];return t.jsxs("section",{className:"fs",dir:d==="ar"?"rtl":"ltr",lang:d,"aria-label":f.title,children:[t.jsxs("div",{className:`fs-hint ${x==="working"?"":"fs-hint-you"}`,children:[t.jsx("b",{children:y.head}),t.jsx("span",{children:y.body}),t.jsxs("div",{className:"fs-acts",children:[t.jsx("button",{className:"btn sm pri",onClick:()=>i(p.id),children:f.open}),t.jsx(D,{className:"note",text:p.title})]})]}),t.jsxs("div",{className:"fs-list",children:[t.jsx("b",{children:f.title}),f.items.map((j,k)=>t.jsxs("div",{className:`fs-item ${k===m?"fs-item-now":""}`,children:[t.jsx("span",{className:`fs-dot ${k<m?"fs-dot-done":""}`,children:k<m&&t.jsx(ge,{size:11,strokeWidth:3,role:"img","aria-label":"Done"})}),t.jsx("span",{children:j})]},j))]}),t.jsx("button",{className:"iconbtn","aria-label":f.hide,title:f.hide,onClick:()=>{_k(o),u(!0)},children:t.jsx(Qe,{size:15})})]})}const o7={en:{head:"Your first story is in.",sub:()=>['"','" now works in your app. Here is what your squad did.'],took:"from your idea to working",doneWhen:'"done when" checked',tests:"automatic tests pass",cost:"of AI use",next:"Write your next story",app:"Open your app",close:"Close",of:"of",time:e=>e<60?`${e} min`:e<2880?`${Math.round(e/60)} h`:`${Math.round(e/1440)} days`},ar:{head:"قصتك الأولى اكتملت.",sub:()=>["«","» تعمل الآن في تطبيقك. هذا ما فعله فريقك."],took:"من فكرتك إلى برنامج يعمل",doneWhen:"شروط الإنجاز التي تم التحقق منها",tests:"اختبارات آلية ناجحة",cost:"من استخدام الذكاء الاصطناعي",next:"اكتب قصتك التالية",app:"افتح تطبيقك",close:"إغلاق",of:"من",time:e=>e<60?tp(e,"دقيقة","دقيقتان","دقائق"):e<2880?tp(Math.round(e/60),"ساعة","ساعتان","ساعات"):tp(Math.round(e/1440),"يوم","يومان","أيام")}};function l7(){const e=Ke(),n=e.data?.ready?e.data:null,s=n?`squad-kit-first-win:${n.meta.project}`:"",[r,i]=C.useState(!1),o=n&&n.meta.engine==="live"&&!r&&!Ok(s)?s7(n.tickets,n.archived??[]):null;return o?t.jsx(c7,{t:o,onClose:()=>{_k(s),i(!0)}}):null}function c7({t:e,onClose:n}){const s=Gt(),r=Pk(),i=pe(),o=fm(),l=o7[o],u=r7(e),d=r.data?.apps?.find(y=>y.start),p=C.useRef(null);C.useEffect(()=>p.current?.focus(),[]),C.useEffect(()=>{const y=j=>{j.key==="Escape"&&n()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[n]);const[f,m]=l.sub(e.title),x=[{value:l.time(u.minutes),label:l.took},...u.doneWhen?[{value:`${u.doneWhen} ${l.of} ${u.doneWhen}`,label:l.doneWhen}]:[],...u.tests?[{value:String(u.tests),label:l.tests}]:[],...u.costUsd?[{value:`$${u.costUsd.toFixed(2)}`,label:l.cost}]:[]];return t.jsx("div",{className:"wl fw",dir:o==="ar"?"rtl":"ltr",lang:o,role:"dialog","aria-modal":"true","aria-label":l.head,children:t.jsxs("div",{className:"wl-in",children:[t.jsxs("div",{className:"wl-top",children:[t.jsxs("div",{className:"wl-logo",dir:"ltr",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("span",{children:"squad-kit"})]}),t.jsx("button",{className:"iconbtn","aria-label":l.close,onClick:n,children:t.jsx(Qe,{size:18})})]}),t.jsxs("div",{className:"wl-main",style:{maxWidth:900},children:[t.jsx(VN,{className:"fw-mark",size:64,strokeWidth:1.75,"aria-hidden":"true"}),t.jsx("h1",{className:"fw-h",children:l.head}),t.jsxs("p",{className:"fw-sub",children:[f,t.jsx(D,{text:e.title}),m]}),t.jsx("div",{className:"fw-stats",children:x.map((y,j)=>t.jsxs("div",{className:"fw-stat",style:{"--d":`${.2+j*.12}s`},children:[t.jsx("b",{children:y.value}),t.jsx("span",{children:y.label})]},y.label))}),t.jsxs("div",{className:"fw-acts",children:[t.jsx("button",{ref:p,className:"wl-cta",onClick:()=>{n(),s({to:"/board",search:{write:1}})},children:l.next}),d&&t.jsx("button",{className:"fw-ghost",disabled:i.isPending,onClick:()=>{i.mutate({path:`/api/v1/apps/${encodeURIComponent(d.name)}/start`,done:`Starting ${d.name}`}),n()},children:l.app})]})]})]})})}function si(e){const n=e.changes?.at(-1);return n&&n.status!=="done"&&n.status!=="declined"?n:void 0}function qs(e){const n=si(e)?.status;return n==="proposed"||n==="failed"||n==="design-ready"}function Xo(e){return!!(e.waiting||e.quiet?.kind==="stuck"||e.outdated?.length||qs(e)||bs(e))}function bs(e){return!!e.testChange?.ask}function mm(e){return bs(e)?"squad-kit cannot tell which way of testing to keep":""}function u7(e,n){return n>0?`(${n}) ${e}`:e}function d7(e,n){const s=Math.max(0,(n-Date.parse(e))/1e3);if(!Number.isFinite(s)||s<60)return"just now";if(s<3600)return`waiting ${Math.round(s/60)} min`;if(s<86400)return`waiting ${Math.round(s/3600)} h`;const r=Math.round(s/86400);return`waiting ${r} ${r===1?"day":"days"}`}function Bk(e){return!e.waiting&&e.quiet?.kind==="stuck"?e.quiet.since:e.activity[0]?.at??e.createdAt}class h7{rank=new Map;next=0;sort(n){const s=n.filter(i=>!this.rank.has(i.key)).sort((i,o)=>i.since.localeCompare(o.since)||i.key.localeCompare(o.key));for(const i of s)this.rank.set(i.key,this.next++);const r=new Set(n.map(i=>i.key));for(const i of this.rank.keys())r.has(i)||this.rank.delete(i);return[...n].sort((i,o)=>this.rank.get(i.key)-this.rank.get(o.key))}}function p7(e){const n=new Set;return e.waiting&&n.add(e.waiting.kind),qs(e)&&n.add("change"),e.quiet?.kind==="stuck"&&n.add("quiet"),e.outdated?.length&&n.add("outdated"),bs(e)&&e.waiting?.kind!=="plan"&&n.add("test-command"),[...n]}const f7=["yours","chat","release"];function m7(e){return!f7.includes(e)}function g7(e,n,s){const r=si(n),i=s==="ask"?n.agentQuestion?.at:s==="change"&&r?`${r.id}-${r.status==="design-ready"?"design":"spec"}`:s==="quiet"?n.quiet?.since:s==="outdated"?n.outdated?.map(o=>o.adr).join("+"):s==="test-command"?n.testChange?.to:void 0;return`${e}/${n.id}/${s}${i?`/${i}`:""}`}function x7(e){return e.flatMap(({project:n,ticket:s})=>p7(s).filter(m7).map(r=>({key:g7(n.id,s,r),project:n,ticket:s,reason:r})))}const ou=2*6e4;class y7{known=null;gone=new Map;next(n,s){const r=new Set(n.map(l=>l.key));if(!this.known)return this.known=r,[];const i=this.known,o=n.filter(l=>!i.has(l.key)&&!(s-(this.gone.get(l.key)??-1/0)<ou));for(const l of i)r.has(l)||this.gone.set(l,s);for(const[l,u]of this.gone)(r.has(l)||s-u>=ou)&&this.gone.delete(l);return this.known=r,o}}const uy="sk.notices.shown";function Wk(e,n,s){if(!s)return!0;let r={};try{r=JSON.parse(s.getItem(uy)??"{}")}catch{r={}}if(n-(r[e]??-1/0)<ou)return!1;const i=Object.fromEntries(Object.entries(r).filter(([,o])=>n-o<ou));i[e]=n;try{s.setItem(uy,JSON.stringify(i))}catch{}return!0}const j7={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"};function k7(e){const n=e.ticket,s={questions:"the squad has questions for you",ask:`the ${j7[n.agentQuestion?.from??""]??"squad"} has a question`,spec:"the spec is ready for you",plan:n.specApproved?"the design is ready for you":"the plan is ready for you",change:"a change waits for you",depends:"it needs a ticket that is not merged yet",proof:"the proof is ready to check",stuck:"the squad stopped and needs you",quiet:"a step looks stuck",outdated:"a newer decision changes the plan","test-command":"a choice about the tests waits for you",yours:"you took it over",chat:"your talk with the squad",release:"ready to release"};return{title:`${n.id}: ${s[e.reason]}`,body:`${n.title} · ${e.project.name}`}}function Uk(e,n){const s=`/p/${encodeURIComponent(e)}`;return n.waiting?.kind==="proof"?`${s}/tickets/${encodeURIComponent(n.id)}/proof`:`${s}/board?ticket=${encodeURIComponent(n.id)}`}const v7=8e3;function b7(e,n){return e?n.secure?e.permission==="granted"||e.permission==="denied"?Promise.resolve(e.permission):new Promise(s=>{let r=!1;const i=u=>{r||(r=!0,clearTimeout(l),s(u))},o=u=>i(u==="granted"||u==="denied"||u==="default"?u:e.permission==="default"?"default":e.permission),l=setTimeout(()=>i(e.permission==="default"?"timeout":e.permission),n.timeoutMs??v7);try{const u=e.requestPermission(o);u&&typeof u.then=="function"&&u.then(o,()=>i(e.permission==="default"?"error":e.permission))}catch{i(e.permission==="default"?"error":e.permission)}}):Promise.resolve("insecure"):Promise.resolve("unsupported")}const ao="Allow notifications for this page in your browser's site settings (the icon next to the address), then reload. On a Mac, also check System Settings › Notifications for your browser.";function w7(e){switch(e){case"granted":return{choice:"on",test:!0,bad:!1,say:"Desktop notices are on. Didn't see one just now? Your computer may block notices for this browser: check the system's notification settings."};case"denied":return{choice:"on",test:!1,bad:!0,say:`Your browser blocks notices from this page. ${ao}`};case"timeout":return{choice:"on",test:!1,bad:!0,say:`Your browser has not answered. ${ao} Notices start once it allows them.`};case"error":return{choice:"on",test:!1,bad:!0,say:`Your browser did not let this page ask. ${ao}`};case"insecure":return{choice:null,test:!1,bad:!0,say:"Your browser shows desktop notices only on a secure page. Open the board on this computer, at its 127.0.0.1 or localhost address, to turn them on."};case"unsupported":return{choice:null,test:!1,bad:!0,say:"This browser can't show desktop notices. The banner and the tab title still show what needs you."};default:return{choice:"off",test:!1,bad:!1,say:"No desktop notices for now. Turn them on in Settings any time."}}}const Hk="Your browser is asking: look near the address bar.";function N7(e,n){const s=e.filter(d=>d.kind==="tests"),r=e.filter(d=>d.kind!=="tests"),i=new Set(r.map(d=>d.id)),o=n.filter(d=>i.has(d.from)&&i.has(d.to)&&d.from!==d.to),l=new Map(r.map(d=>[d.id,0]));for(let d=0;d<r.length;d+=1){let p=!1;for(const f of o){const m=l.get(f.from)+1;m>l.get(f.to)&&m<r.length&&(l.set(f.to,m),p=!0)}if(!p)break}const u=[];for(const d of r)(u[l.get(d.id)]??=[]).push(d);return{columns:u.filter(Boolean),below:s}}function S7(e,n,s){return s.filter(r=>r.from===e.id).map(r=>`${r.label??"uses"} ${n.find(i=>i.id===r.to)?.name??r.to}`).join(" · ")}function af(e,n){if(e.state==="now"&&e.since){const s=Math.max(0,Math.floor((n-Date.parse(e.since))/1e3));return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}return e.state==="todo"||e.state==="skipped"||e.seconds===void 0?"":e.seconds<60?`${Math.max(1,e.seconds)} s`:`${Math.round(e.seconds/60)} min`}const Vk="sk.notices.setup";function Co(e){try{const n=JSON.parse(e?.getItem(Vk)??"[]");return Array.isArray(n)?n.filter(s=>typeof s=="string"):[]}catch{return[]}}function Kk(e,n){try{e?.setItem(Vk,JSON.stringify([...new Set(n)]))}catch{}}function C7(e,n){Kk(e,[...Co(e),n])}function $7(e,n){Kk(e,Co(e).filter(s=>s!==n))}function T7(e,n){return e.filter(s=>n.includes(s.id)&&s.setup?.ready&&!s.setup.approved)}function E7(e){return{title:`${e} is ready`,body:"squad-kit has read your project. Check what it understood, then start."}}function Yk(e,n){return(e??[]).filter(s=>s.repo===n&&!s.shared).map(s=>s.name)}function Me(e){return/["$`\\!]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:`"${e}"`}function na(e){return/^[\w@%+=:,./#-]+$/.test(e)&&!e.startsWith("#")?e:Me(e)}function Gk(e){let n;do n=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==n);return e}const dy="Skip: let the Analyst decide",A7={reading:"Analyst reading",questions:"Questions for you",drafting:"Analyst writing the breakdown",ready:"Ready for you to approve",approved:"Approved",failed:"Stopped"},P7={reading:"ok",questions:"you",drafting:"ok",ready:"you",approved:"ok",failed:"bug"};function Qk(e){if(e.status!=="approved")return{text:A7[e.status],tone:P7[e.status]};if(e.counts.stories>0&&e.counts.merged===e.counts.stories)return{text:"Built",tone:"ok"};const n=e.state?.build;return n?.on?{text:"Building continuously",tone:"ok"}:n?{text:"Paused",tone:"plain"}:e.building?{text:"Building",tone:"ok"}:{text:"Approved",tone:"ok"}}function R7(e){return Qk({status:e.status,counts:e.counts,building:e.building})}function Yt(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function I7(e){return`${Yt(e.epics,"epic")}, ${Yt(e.features,"feature")}, ${Yt(e.stories,"story","stories")}`}function F7(e){if(e<90)return`${Math.max(1,Math.round(e))} min`;const n=Math.round(e/30)/2;return`${n} ${n===1?"hour":"hours"}`}function z7(e){return e>0&&e<1?"under $1":`$${Math.round(e)}`}function Zk(e){return e.rough?"a rough guess: no finished tickets yet":`based on ${Yt(e.basedOn,"finished ticket")}`}function gm(e){return{...e.costUsd!==void 0?{cost:z7(e.costUsd)}:{},time:F7(e.minutes)}}function L7(e){if(!e.stories)return"Every story is merged.";const{cost:n,time:s}=gm(e);return`${Yt(e.stories,"story","stories")}, about ${n?`${n} and `:""}${s}, ${e.parallel} at a time, ${Zk(e)}`}function M7(e){if(!e.stories)return"Every story is merged";const{cost:n,time:s}=gm(e);return`About ${s}${n?` and ${n}`:""} left`}function ri(e){return!!(e&&(e.status==="pending"||e.status==="running"||e.status==="stopping"))}const Xk=e=>e.charAt(0).toUpperCase()+e.slice(1);function q7(e){return e?`${Xk(e.unit)} ${Math.max(1,Math.min(e.done,e.of||e.done))} of ${e.of}`:""}function np(e){if(!e||!e.epics&&!e.features&&!e.stories)return"";const n=[Yt(e.epics,"epic"),Yt(e.features,"feature"),...e.stories?[Yt(e.stories,"story","stories")]:[]];return`Found ${n.length===3?`${n[0]}, ${n[1]} and ${n[2]}`:n.join(" and ")} so far.`}function hy(e){return e<60?"less than a minute":`${Math.round(e/60)} min`}function O7(e,n=Date.now()){if(!e)return"";const s=e.startedAt?Math.max(0,(n-Date.parse(e.startedAt))/1e3):null,r=e.usualSeconds?`usually about ${hy(e.usualSeconds)}${e.at?.of?` for ${Yt(e.at.of,e.at.unit)}`:""}`:"";return[s!==null?`${hy(s)} so far`:"",r].filter(Boolean).join(", ")}function _7(e){const n=e.source,s=n.pictures?`, tables and ${Yt(n.pictures,"picture")}, so the Analyst sees the mockups too`:" and tables";return n.kind==="docx"?{title:"Turned the Word file into text",sub:`Kept the headings${s}.`}:n.kind==="pdf"?{title:"Kept the PDF as it is",sub:`The Analyst reads ${n.pages?`its ${Yt(n.pages,"page")}`:"it"} directly, pictures and all.`}:n.kind==="pasted"?{title:"Saved the pasted text",sub:n.pages&&n.pages>1?`In ${n.pages} parts, so the Analyst reads it part by part.`:"The Analyst reads it as you pasted it."}:{title:"Saved the text",sub:n.pages&&n.pages>1?`In ${n.pages} parts, so the Analyst reads it part by part.`:"The Analyst reads it as it is."}}function D7(e){const n=e.state.job,s=n?.step,r=e.status==="failed",i=["text","read","questions","draft"],o=e.status==="questions"?"questions":e.status==="drafting"||s==="draft"?"draft":s==="text"?"text":e.status==="ready"||e.status==="approved"?"draft":"read",l=i.indexOf(o),u=e.status==="ready"||e.status==="approved",d=x=>{const y=i.indexOf(x);return u||y<l?"done":y>l?"todo":r?"failed":"now"},p=o==="read"&&n?[q7(n.at),np(n.found)].filter(Boolean):[],f=n?.status==="pending"&&n.now?n.now:"",m=e.questions.length;return[{key:"text",..._7(e),state:d("text")},{key:"read",title:"Reading the document",sub:d("read")==="now"?f&&!n?.at?.done?`${f}.`:p.length?`${p[0]}${p[1]?`. ${p[1]}`:"."}`:"Starting to read.":d("read")==="failed"?"It stopped here. Nothing it found is lost.":d("read")==="done"?"Read the whole document.":"Page by page, writing down the epics and features it finds.",state:d("read"),...o==="read"&&n?.at?.of?{bar:{done:n.at.done,of:n.at.of}}:{}},{key:"questions",title:"Questions for you",sub:d("questions")==="done"&&l>2?m?`${Yt(m,"question")}, answered.`:"None: the BRD was clear.":"Only when something is missing or two parts clash. Small things it decides and writes down.",state:d("questions")},{key:"draft",title:"Writing the epics, features and stories",sub:d("draft")==="now"&&n?.now?`${n.now}.${np(n.found)?` ${np(n.found)}`:""}`:'Each story gets "done when" checks, its size, what it needs first, and where it comes from in the BRD.',state:d("draft")}]}function Jo(e){return e?[[e.section,e.title].filter(Boolean).join(" "),e.page?`page ${e.page}`:""].filter(Boolean).join(", "):""}function B7(e){return/^\d/.test(e.trim())?`From section ${e.trim()}`:`From ${e.trim()}`}function W7(e){return[e.section??e.title,e.page?`page ${e.page}`:""].filter(Boolean).join(", ")}function el(e){return e.epics.flatMap(n=>[...n.features.flatMap(s=>s.stories.map(r=>({story:r,epic:n,feature:s}))),...n.stories.map(s=>({story:s,epic:n}))])}function Un(e,n){if(!n)return null;for(const s of e.epics){if(s.key===n)return{level:"epic",item:s,epic:s};for(const i of s.features){if(i.key===n)return{level:"feature",item:i,epic:s,feature:i};const o=i.stories.find(l=>l.key===n);if(o)return{level:"story",item:o,epic:s,feature:i,story:o}}const r=s.stories.find(i=>i.key===n);if(r)return{level:"story",item:r,epic:s,story:r}}return null}function ii(e){return"features"in e?[...e.features.flatMap(n=>n.stories),...e.stories]:e.stories}function U7(e){return e.level==="epic"?"":[e.epic.title,e.level==="story"?e.feature?.title:void 0].filter(Boolean).join(" › ")}function Jk(e){const n=Yt(ii(e).length,"story","stories");return"features"in e&&e.features.length?`${Yt(e.features.length,"feature")}, ${n}`:n}function H7(e,n){return n.level==="epic"?[]:n.level==="feature"?e.epics.map(s=>({key:s.key,label:`${s.key} ${s.title}`})):e.epics.flatMap(s=>[...s.features.map(r=>({key:r.key,label:`${s.title} › ${r.title}`})),{key:s.key,label:`${s.title}, straight under the epic`}])}function V7(e){if(e.level!=="epic")return e.level==="feature"?e.epic.key:e.feature?.key??e.epic.key}const K7=["merged","released"];function Fu(e){return!!(e&&K7.includes(e))}function lu(e,n){return{done:e.filter(s=>Fu(n.get(s.key)?.state)).length,of:e.length}}function Y7(e){const n=Math.max(0,e.stories-e.merged-e.building-e.needsYou);return{merged:e.merged,building:e.building,needsYou:e.needsYou,rest:n}}function py(e,n){const s=new Map(e.progress.map(r=>[r.key,r]));return el(e).filter(({story:r})=>r.dependsOn.includes(n)&&!Fu(s.get(r.key)?.state)).map(({story:r})=>r.key)}function G7(e,n){const s=new Map(e.progress.map(r=>[r.key,r]));return n.dependsOn.filter(r=>!Fu(s.get(r)?.state))}function ev(e){return e==="clash"?"Two parts clash":e==="gap"?"Missing in the BRD":e==="check"?"A check failed":"Needs you"}function tv(e){const n=/^(.+?[.?!])(\s|$)/.exec(e.trim());return(n?n[1]:e).trim()}function fy(e,n){const s=new Set,r=new Map(e.progress.map(u=>[u.key,u.state])),i=["building","needs-you","next","waits"],o=e.progress.some(u=>i.includes(u.state)),l=Un(e,n);return e.epics.forEach((u,d)=>{const p=l?.epic.key===u.key,f=ii(u).some(m=>i.includes(r.get(m.key)));(p||(o?f:d===0))&&s.add(u.key);for(const m of u.features){const x=m.stories.some(y=>i.includes(r.get(y.key)));(l?.feature?.key===m.key||l?.item.key===m.key||(o?x:d===0))&&s.add(m.key)}}),s}const Q7={analyst:"Analyst",architect:"Architect",builder:"Builder",tester:"Tester",reviewer:"Reviewer",answer:"from your answer"};function my(e){return[e.item,e.ticket,Q7[e.by]??e.by].filter(Boolean).join(" · ")}function sp(e){const n=e.trim().split(/\s+/),s=n.pop()??"",r=/[^aeiou]y$/i.test(s)?`${s.slice(0,-1)}ies`:/s$/i.test(s)?s:`${s}s`;return[...n,r].map((o,l)=>l===0?Xk(o.toLowerCase()):o.toLowerCase()).join(" ")}function rp(e,n){if(n||e.new===e.all&&e.all>0)return"new";const s=[e.new?`${e.new} new`:"",e.changed?`${e.changed} changed`:""].filter(Boolean);return s.length?s.join(", "):"no changes"}function Z7(e){const n=el(e).find(({story:s})=>s.dependsOn.length);return n?`${n.story.key} needs ${n.story.dependsOn[0]}`:null}function of(e,n){if(!e)return{phase:"unknown",of:0,pct:0};const s=(p,f)=>f>0?Math.min(100,Math.round(p/f*100)):5,r=n&&(!n.at||!e.at||n.at===e.at)?n:null,i=e.links,o=e.items?.of??r?.items??(i?e.of:void 0);if(o===void 0)return{phase:"unknown",of:e.of,pct:s(e.done,e.of)};const l=e.items?.done??Math.min(e.done,o),u=i?.of??r?.links??0,d=e.items||i?s(l+(i?.done??0),o+(i?.of??0)):s(e.done,e.of);return l>=o&&u>0?{phase:"links",...i?{done:i.done}:{},of:u,pct:d}:{phase:"items",done:l,of:o,pct:d}}function nv(e){return e.phase==="links"?e.done===void 0?`adding the ${Yt(e.of,"link")}`:`adding the links, ${e.done} of ${e.of}`:e.phase==="items"?`${e.done} of ${Yt(e.of,"item")}`:""}function X7(e){const n=e.counts.stories;if(!n||e.counts.merged<n)return null;const s=n===1?"The story is merged":`All ${n} stories are merged`;return e.progress.length>0&&e.progress.every(i=>i.state==="released")?{text:`${s} and went out in a release.`,release:!1}:{text:`${s} and ${n===1?"waits":"wait"} in the next release.`,release:!0}}function sv(e,n){return n?/^c\d+$/.test(n)?`It became a small change on ${e}. The Analyst writes it into the spec.`:`${e} is merged, so it became a new ticket, ${n}, linked to it.`:`Changed on ${e}.`}function J7(e,n){const s=e.trim(),r=n.trim().replace(/[.!]$/,"").toLowerCase();return!r||!s.toLowerCase().startsWith(r)?s:s.slice(r.length).replace(/^[.!]?\s*/,"")||s}const lf=e=>!e.trim();function ip(e){const n=[e.given,e.when,e.then];return n.some(lf)&&!n.every(lf)}function gy(e){return e.filter(n=>![n.given,n.when,n.then].every(lf))}function xy(e){return`Add the part that was left out: ${e.text}${e.ref?` (${Jo(e.ref)})`:""}.`}function e9(e,n){const s=r=>!n||r.owner.trim().toLowerCase()===n.trim().toLowerCase();return e.filter(s).reduce((r,i)=>r+(i.status==="questions"?1:0)+i.counts.needsYou,0)}const Is={col:172,gap:14,epicGap:44,pad:24,epicH:74,featY:160,featH:72,storyY:258,storyH:44,storyStep:50,popW:300,popH:150,rowWidth:1600};function t9(e,n=Is.rowWidth){const{col:s,gap:r,epicGap:i,pad:o,epicH:l,featY:u,featH:d,storyY:p,storyH:f,storyStep:m}=Is,x=new Map(e.progress.map(E=>[E.key,E])),y=[],j=[],k=l+(u-l)/2;let b=o,S=0,N=o,$=o+u+d,A=o*2+s;const R=(E,M,F)=>{E.forEach((W,I)=>{y.push({key:W.key,level:"story",row:S,x:M,y:F+I*m,w:s,h:f,title:W.title,state:x.get(W.key)?.state??"not-started"})}),E.length&&($=Math.max($,F+(E.length-1)*m+f))};for(const E of e.epics){const M=[...E.features.map(L=>({kind:"feature",f:L})),...E.stories.length?[{kind:"stories"}]:[]],F=Math.max(1,M.length),W=F*s+(F-1)*r;b>o&&b+W+o>n&&(S+=1,b=o,N=$+i,$=N+u+d);const I=b+W/2;y.push({key:E.key,level:"epic",row:S,x:b,y:N,w:W,h:l,title:E.title,done:lu(ii(E),x)});const q=M.map((L,U)=>b+U*(s+r)+s/2);q.length&&(j.push({x1:I,y1:N+l,x2:I,y2:N+k}),j.push({x1:Math.min(I,q[0]),y1:N+k,x2:Math.max(I,q.at(-1)),y2:N+k})),M.forEach((L,U)=>{const _=b+U*(s+r),G=q[U];L.kind==="feature"?(j.push({x1:G,y1:N+k,x2:G,y2:N+u}),y.push({key:L.f.key,level:"feature",row:S,x:_,y:N+u,w:s,h:d,title:L.f.title,done:lu(L.f.stories,x)}),L.f.stories.length&&j.push({x1:G,y1:N+u+d,x2:G,y2:N+p}),R(L.f.stories,_,N+p)):(j.push({x1:G,y1:N+k,x2:G,y2:N+p}),R(E.stories,_,N+p))}),A=Math.max(A,b+W+o),b+=W+i}return{boxes:y,lines:j,width:A,height:$+o}}function xm(e){return Fu(e)?"m":e==="building"?"b":e==="needs-you"?"y":"w"}function n9(e,n){const s=Math.max(Is.pad/2,Math.min(n.x,e.width-Is.popW-Is.pad/2)),r=s+Is.popW,i=e.boxes.filter(l=>l.level!=="epic"&&l.row===n.row&&l.x<r&&l.x+l.w>s).map(l=>l.y+l.h),o=Math.max(n.y+n.h,...i)+14;return{left:s,top:o,height:Math.max(e.height,o+Is.popH+Is.pad)}}function s9(e,n){if(!n.width||!n.height)return 1;const s=Math.min(n.width/e.width,n.height/e.height,1);return Math.max(.3,Math.round(s*100)/100)}function r9(e,n){return n.width?Math.max(.6,Math.min(1,Math.round(n.width/e.width*100)/100)):1}const rv="sk.chatdock",cf=new Set;function i9(){try{const e=JSON.parse(localStorage.getItem(rv)??"{}");return{tab:e.tab??null,min:!!e.min,width:iv(e.width??600),seen:e.seen??{}}}catch{return{tab:null,min:!1,width:600,seen:{}}}}let Br=typeof window>"u"?{tab:null,min:!1,width:600,seen:{}}:i9();function iv(e){return Math.max(440,Math.min(900,Math.round(e)))}function Fi(e){Br={...Br,...e};try{localStorage.setItem(rv,JSON.stringify(Br))}catch{}for(const n of cf)n()}const gs={get:()=>Br,show:e=>Fi({tab:e,min:!1}),pick:e=>Fi({tab:e}),minimize:()=>Fi({min:!0}),restore:()=>Fi({min:!1}),resize:e=>Fi({width:iv(e)}),seen:(e,n)=>{Br.seen[e]!==n&&Fi({seen:{...Br.seen,[e]:n}})}};function sa(e){return C.useSyncExternalStore(n=>{const s=window.matchMedia?.(e);return s?.addEventListener("change",n),()=>s?.removeEventListener("change",n)},()=>!!window.matchMedia?.(e).matches)}const ra="(max-width: 760px)";function zu(){return C.useSyncExternalStore(e=>(cf.add(e),()=>cf.delete(e)),()=>Br)}function a9(e,n){const s={};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const o9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c9={};function yy(e,n){return(c9.jsx?l9:o9).test(e)}const u9=/[ \t\n\f\r]/g;function d9(e){return typeof e=="object"?e.type==="text"?jy(e.value):!1:jy(e)}function jy(e){return e.replace(u9,"")===""}class tl{constructor(n,s,r){this.normal=s,this.property=n,r&&(this.space=r)}}tl.prototype.normal={};tl.prototype.property={};tl.prototype.space=void 0;function av(e,n){const s={},r={};for(const i of e)Object.assign(s,i.property),Object.assign(r,i.normal);return new tl(s,r,n)}function uf(e){return e.toLowerCase()}class fn{constructor(n,s){this.attribute=s,this.property=n}}fn.prototype.attribute="";fn.prototype.booleanish=!1;fn.prototype.boolean=!1;fn.prototype.commaOrSpaceSeparated=!1;fn.prototype.commaSeparated=!1;fn.prototype.defined=!1;fn.prototype.mustUseProperty=!1;fn.prototype.number=!1;fn.prototype.overloadedBoolean=!1;fn.prototype.property="";fn.prototype.spaceSeparated=!1;fn.prototype.space=void 0;let h9=0;const qe=ai(),bt=ai(),df=ai(),de=ai(),nt=ai(),Bi=ai(),vn=ai();function ai(){return 2**++h9}const hf=Object.freeze(Object.defineProperty({__proto__:null,boolean:qe,booleanish:bt,commaOrSpaceSeparated:vn,commaSeparated:Bi,number:de,overloadedBoolean:df,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),ap=Object.keys(hf);class ym extends fn{constructor(n,s,r,i){let o=-1;if(super(n,s),ky(this,"space",i),typeof r=="number")for(;++o<ap.length;){const l=ap[o];ky(this,ap[o],(r&hf[l])===hf[l])}}}ym.prototype.defined=!0;function ky(e,n,s){s&&(e[n]=s)}function ia(e){const n={},s={};for(const[r,i]of Object.entries(e.properties)){const o=new ym(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,s[uf(r)]=r,s[uf(o.attribute)]=r}return new tl(n,s,e.space)}const ov=ia({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:nt,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:de,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:nt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:bt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function lv(e,n){return n in e?e[n]:n}function cv(e,n){return lv(e,n.toLowerCase())}const p9=ia({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bi,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:qe,allowPaymentRequest:qe,allowUserMedia:qe,alt:null,as:null,async:qe,autoCapitalize:null,autoComplete:nt,autoFocus:qe,autoPlay:qe,blocking:nt,capture:null,charSet:null,checked:qe,cite:null,className:nt,cols:de,colSpan:null,content:null,contentEditable:bt,controls:qe,controlsList:nt,coords:de|Bi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:qe,defer:qe,dir:null,dirName:null,disabled:qe,download:df,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:qe,formTarget:null,headers:nt,height:de,hidden:df,high:de,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:qe,inputMode:null,integrity:null,is:null,isMap:qe,itemId:null,itemProp:nt,itemRef:nt,itemScope:qe,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:qe,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:qe,muted:qe,name:null,nonce:null,noModule:qe,noValidate:qe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:qe,optimum:de,pattern:null,ping:nt,placeholder:null,playsInline:qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:qe,referrerPolicy:null,rel:nt,required:qe,reversed:qe,rows:de,rowSpan:de,sandbox:nt,scope:null,scoped:qe,seamless:qe,selected:qe,shadowRootClonable:qe,shadowRootDelegatesFocus:qe,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:qe,useMap:null,value:bt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:qe,declare:qe,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:qe,noHref:qe,noShade:qe,noWrap:qe,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:qe,disableRemotePlayback:qe,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:cv}),f9=ia({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bi,g2:Bi,glyphName:Bi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vn,rev:vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vn,requiredFeatures:vn,requiredFonts:vn,requiredFormats:vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lv}),uv=ia({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),dv=ia({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:cv}),hv=ia({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),m9={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},g9=/[A-Z]/g,vy=/-[a-z]/g,x9=/^data[-\w.:]+$/i;function y9(e,n){const s=uf(n);let r=n,i=fn;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&x9.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(vy,k9);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!vy.test(o)){let l=o.replace(g9,j9);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=ym}return new i(r,n)}function j9(e){return"-"+e.toLowerCase()}function k9(e){return e.charAt(1).toUpperCase()}const v9=av([ov,p9,uv,dv,hv],"html"),jm=av([ov,f9,uv,dv,hv],"svg");function b9(e){return e.join(" ").trim()}var zi={},op,by;function w9(){if(by)return op;by=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,s=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
584
+ `,p="/",f="*",m="",x="comment",y="declaration";function j(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var N=1,$=1;function A(_){var G=_.match(n);G&&(N+=G.length);var le=_.lastIndexOf(d);$=~le?_.length-le:$+_.length}function R(){var _={line:N,column:$};return function(G){return G.position=new E(_),W(),G}}function E(_){this.start=_,this.end={line:N,column:$},this.source=S.source}E.prototype.content=b;function M(_){var G=new Error(S.source+":"+N+":"+$+": "+_);if(G.reason=_,G.filename=S.source,G.line=N,G.column=$,G.source=b,!S.silent)throw G}function F(_){var G=_.exec(b);if(G){var le=G[0];return A(le),b=b.slice(le.length),G}}function W(){F(s)}function I(_){var G;for(_=_||[];G=q();)G!==!1&&_.push(G);return _}function q(){var _=R();if(!(p!=b.charAt(0)||f!=b.charAt(1))){for(var G=2;m!=b.charAt(G)&&(f!=b.charAt(G)||p!=b.charAt(G+1));)++G;if(G+=2,m===b.charAt(G-1))return M("End of comment missing");var le=b.slice(2,G-2);return $+=2,A(le),b=b.slice(G),$+=2,_({type:x,comment:le})}}function L(){var _=R(),G=F(r);if(G){if(q(),!F(i))return M("property missing ':'");var le=F(o),V=_({type:y,property:k(G[0].replace(e,m)),value:le?k(le[0].replace(e,m)):m});return F(l),V}}function U(){var _=[];I(_);for(var G;G=L();)G!==!1&&(_.push(G),I(_));return _}return W(),U()}function k(b){return b?b.replace(u,m):m}return op=j,op}var wy;function N9(){if(wy)return zi;wy=1;var e=zi&&zi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=s;const n=e(w9());function s(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),u=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:p,value:f}=d;u?i(p,f,d):f&&(o=o||{},o[p]=f)}),o}return zi}var Xa={},Ny;function S9(){if(Ny)return Xa;Ny=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,s=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(p){return!p||s.test(p)||e.test(p)},l=function(p,f){return f.toUpperCase()},u=function(p,f){return"".concat(f,"-")},d=function(p,f){return f===void 0&&(f={}),o(p)?p:(p=p.toLowerCase(),f.reactCompat?p=p.replace(i,u):p=p.replace(r,u),p.replace(n,l))};return Xa.camelCase=d,Xa}var Ja,Sy;function C9(){if(Sy)return Ja;Sy=1;var e=Ja&&Ja.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(N9()),s=S9();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(u,d){u&&d&&(l[(0,s.camelCase)(u,o)]=d)}),l}return r.default=r,Ja=r,Ja}var $9=C9();const T9=qf($9),pv=fv("end"),km=fv("start");function fv(e){return n;function n(s){const r=s&&s.position&&s.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function E9(e){const n=km(e),s=pv(e);if(n&&s)return{start:n,end:s}}function oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cy(e.position):"start"in e||"end"in e?Cy(e):"line"in e||"column"in e?pf(e):""}function pf(e){return $y(e&&e.line)+":"+$y(e&&e.column)}function Cy(e){return pf(e&&e.start)+"-"+pf(e&&e.end)}function $y(e){return e&&typeof e=="number"?e:1}class Qt extends Error{constructor(n,s,r){super(),typeof s=="string"&&(r=s,s=void 0);let i="",o={},l=!1;if(s&&("line"in s&&"column"in s?o={place:s}:"start"in s&&"end"in s?o={place:s}:"type"in s?o={ancestors:[s],place:s.position}:o={...s}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=oo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qt.prototype.file="";Qt.prototype.name="";Qt.prototype.reason="";Qt.prototype.message="";Qt.prototype.stack="";Qt.prototype.column=void 0;Qt.prototype.line=void 0;Qt.prototype.ancestors=void 0;Qt.prototype.cause=void 0;Qt.prototype.fatal=void 0;Qt.prototype.place=void 0;Qt.prototype.ruleId=void 0;Qt.prototype.source=void 0;const vm={}.hasOwnProperty,A9=new Map,P9=/[A-Z]/g,R9=new Set(["table","tbody","thead","tfoot","tr"]),I9=new Set(["td","th"]),mv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function F9(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=B9(s,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=D9(s,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?jm:v9,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=gv(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function gv(e,n,s){if(n.type==="element")return z9(e,n,s);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return L9(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return q9(e,n,s);if(n.type==="mdxjsEsm")return M9(e,n);if(n.type==="root")return O9(e,n,s);if(n.type==="text")return _9(e,n)}function z9(e,n,s){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=jm,e.schema=i),e.ancestors.push(n);const o=yv(e,n.tagName,!1),l=W9(e,n);let u=wm(e,n);return R9.has(n.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!d9(d):!0})),xv(e,l,o,n),bm(l,u),e.ancestors.pop(),e.schema=r,e.create(n,o,l,s)}function L9(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$o(e,n.position)}function M9(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);$o(e,n.position)}function q9(e,n,s){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=jm,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:yv(e,n.name,!0),l=U9(e,n),u=wm(e,n);return xv(e,l,o,n),bm(l,u),e.ancestors.pop(),e.schema=r,e.create(n,o,l,s)}function O9(e,n,s){const r={};return bm(r,wm(e,n)),e.create(n,e.Fragment,r,s)}function _9(e,n){return n.value}function xv(e,n,s,r){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(n.node=r)}function bm(e,n){if(n.length>0){const s=n.length>1?n:n[0];s&&(e.children=s)}}function D9(e,n,s){return r;function r(i,o,l,u){const p=Array.isArray(l.children)?s:n;return u?p(o,l,u):p(o,l)}}function B9(e,n){return s;function s(r,i,o,l){const u=Array.isArray(o.children),d=km(r);return n(i,o,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function W9(e,n){const s={};let r,i;for(i in n.properties)if(i!=="children"&&vm.call(n.properties,i)){const o=H9(e,i,n.properties[i]);if(o){const[l,u]=o;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&I9.has(n.tagName)?r=u:s[l]=u}}if(r){const o=s.style||(s.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return s}function U9(e,n){const s={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const u=l.properties[0];u.type,Object.assign(s,e.evaluater.evaluateExpression(u.argument))}else $o(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else $o(e,n.position);else o=r.value===null?!0:r.value;s[i]=o}return s}function wm(e,n){const s=[];let r=-1;const i=e.passKeys?new Map:A9;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const p=i.get(d)||0;l=d+"-"+p,i.set(d,p+1)}}const u=gv(e,o,l);u!==void 0&&s.push(u)}return s}function H9(e,n,s){const r=y9(e.schema,n);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=r.commaSeparated?a9(s):b9(s)),r.property==="style"){let i=typeof s=="object"?s:V9(e,String(s));return e.stylePropertyNameCase==="css"&&(i=K9(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?m9[r.property]||r.property:r.attribute,s]}}function V9(e,n){try{return T9(n,{reactCompat:!0})}catch(s){if(e.ignoreInvalidStyle)return{};const r=s,i=new Qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=mv+"#cannot-parse-style-attribute",i}}function yv(e,n,s){let r;if(!s)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const u=yy(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=l}else r=yy(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return vm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$o(e)}function $o(e,n){const s=new Qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=mv+"#cannot-handle-mdx-estrees-without-createevaluater",s}function K9(e){const n={};let s;for(s in e)vm.call(e,s)&&(n[Y9(s)]=e[s]);return n}function Y9(e){let n=e.replace(P9,G9);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function G9(e){return"-"+e.toLowerCase()}const lp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Q9={};function Nm(e,n){const s=Q9,r=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,i=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return jv(e,r,i)}function jv(e,n,s){if(Z9(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ty(e.children,n,s)}return Array.isArray(e)?Ty(e,n,s):""}function Ty(e,n,s){const r=[];let i=-1;for(;++i<e.length;)r[i]=jv(e[i],n,s);return r.join("")}function Z9(e){return!!(e&&typeof e=="object")}const Ey=document.createElement("i");function Sm(e){const n="&"+e+";";Ey.innerHTML=n;const s=Ey.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===n?!1:s}function Nn(e,n,s,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,s=s>0?s:0,r.length<1e4)l=Array.from(r),l.unshift(n,s),e.splice(...l);else for(s&&e.splice(n,s);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function On(e,n){return e.length>0?(Nn(e,e.length,0,n),e):n}const Ay={}.hasOwnProperty;function kv(e){const n={};let s=-1;for(;++s<e.length;)X9(n,e[s]);return n}function X9(e,n){let s;for(s in n){const i=(Ay.call(e,s)?e[s]:void 0)||(e[s]={}),o=n[s];let l;if(o)for(l in o){Ay.call(i,l)||(i[l]=[]);const u=o[l];J9(i[l],Array.isArray(u)?u:u?[u]:[])}}}function J9(e,n){let s=-1;const r=[];for(;++s<n.length;)(n[s].add==="after"?e:r).push(n[s]);Nn(e,0,0,r)}function vv(e,n){const s=Number.parseInt(e,n);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function rs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=vr(/[A-Za-z]/),Ht=vr(/[\dA-Za-z]/),eS=vr(/[#-'*+\--9=?A-Z^-~]/);function cu(e){return e!==null&&(e<32||e===127)}const ff=vr(/\d/),tS=vr(/[\dA-Fa-f]/),nS=vr(/[!-/:-@[-`{-~]/);function Pe(e){return e!==null&&e<-2}function et(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const Lu=vr(/\p{P}|\p{S}/u),Yr=vr(/\s/);function vr(e){return n;function n(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function aa(e){const n=[];let s=-1,r=0,i=0;for(;++s<e.length;){const o=e.charCodeAt(s);let l="";if(o===37&&Ht(e.charCodeAt(s+1))&&Ht(e.charCodeAt(s+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(s+1);o<56320&&u>56319&&u<57344?(l=String.fromCharCode(o,u),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,s),encodeURIComponent(l)),r=s+i+1,l=""),i&&(s+=i,i=0)}return n.join("")+e.slice(r)}function Ue(e,n,s,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(d){return Be(d)?(e.enter(s),u(d)):n(d)}function u(d){return Be(d)&&o++<i?(e.consume(d),u):(e.exit(s),n(d))}}const sS={tokenize:rS};function rS(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let s;return n;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ue(e,n,"linePrefix")}function i(u){return e.enter("paragraph"),o(u)}function o(u){const d=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=d),s=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Pe(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),l)}}const iS={tokenize:aS},Py={tokenize:oS};function aS(e){const n=this,s=[];let r=0,i,o,l;return u;function u($){if(r<s.length){const A=s[r];return n.containerState=A[1],e.attempt(A[0].continuation,d,p)($)}return p($)}function d($){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&N();const A=n.events.length;let R=A,E;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){E=n.events[R][1].end;break}S(r);let M=A;for(;M<n.events.length;)n.events[M][1].end={...E},M++;return Nn(n.events,R+1,0,n.events.slice(A)),n.events.length=M,p($)}return u($)}function p($){if(r===s.length){if(!i)return x($);if(i.currentConstruct&&i.currentConstruct.concrete)return j($);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Py,f,m)($)}function f($){return i&&N(),S(r),x($)}function m($){return n.parser.lazy[n.now().line]=r!==s.length,l=n.now().offset,j($)}function x($){return n.containerState={},e.attempt(Py,y,j)($)}function y($){return r++,s.push([n.currentConstruct,n.containerState]),x($)}function j($){if($===null){i&&N(),S(0),e.consume($);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k($)}function k($){if($===null){b(e.exit("chunkFlow"),!0),S(0),e.consume($);return}return Pe($)?(e.consume($),b(e.exit("chunkFlow")),r=0,n.interrupt=void 0,u):(e.consume($),k)}function b($,A){const R=n.sliceStream($);if(A&&R.push(null),$.previous=o,o&&(o.next=$),o=$,i.defineSkip($.start),i.write(R),n.parser.lazy[$.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<l&&(!i.events[E][1].end||i.events[E][1].end.offset>l))return;const M=n.events.length;let F=M,W,I;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(W){I=n.events[F][1].end;break}W=!0}for(S(r),E=M;E<n.events.length;)n.events[E][1].end={...I},E++;Nn(n.events,F+1,0,n.events.slice(M)),n.events.length=E}}function S($){let A=s.length;for(;A-- >$;){const R=s[A];n.containerState=R[1],R[0].exit.call(n,e)}s.length=$}function N(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function oS(e,n,s){return Ue(e,e.attempt(this.parser.constructs.document,n,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yi(e){if(e===null||et(e)||Yr(e))return 1;if(Lu(e))return 2}function Mu(e,n,s){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,s),r.push(o))}return n}const mf={name:"attention",resolveAll:lS,tokenize:cS};function lS(e,n){let s=-1,r,i,o,l,u,d,p,f;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(r=s;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[r][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const m={...e[r][1].end},x={...e[s][1].start};Ry(m,-d),Ry(x,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:x},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[s][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[s][1].start={...u.end},p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=On(p,[["enter",e[r][1],n],["exit",e[r][1],n]])),p=On(p,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),p=On(p,Mu(n.parser.constructs.insideSpan.null,e.slice(r+1,s),n)),p=On(p,[["exit",o,n],["enter",u,n],["exit",u,n],["exit",i,n]]),e[s][1].end.offset-e[s][1].start.offset?(f=2,p=On(p,[["enter",e[s][1],n],["exit",e[s][1],n]])):f=0,Nn(e,r-1,s-r+3,p),s=r+p.length-f-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function cS(e,n){const s=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Yi(r);let o;return l;function l(d){return o=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===o)return e.consume(d),u;const p=e.exit("attentionSequence"),f=Yi(d),m=!f||f===2&&i||s.includes(d),x=!i||i===2&&f||s.includes(r);return p._open=!!(o===42?m:m&&(i||!x)),p._close=!!(o===42?x:x&&(f||!m)),n(d)}}function Ry(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const uS={name:"autolink",tokenize:dS};function dS(e,n,s){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return en(y)?(e.consume(y),l):y===64?s(y):p(y)}function l(y){return y===43||y===45||y===46||Ht(y)?(r=1,u(y)):p(y)}function u(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Ht(y))&&r++<32?(e.consume(y),u):(r=0,p(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),n):y===null||y===32||y===60||cu(y)?s(y):(e.consume(y),d)}function p(y){return y===64?(e.consume(y),f):eS(y)?(e.consume(y),p):s(y)}function f(y){return Ht(y)?m(y):s(y)}function m(y){return y===46?(e.consume(y),r=0,f):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),n):x(y)}function x(y){if((y===45||Ht(y))&&r++<63){const j=y===45?x:m;return e.consume(y),j}return s(y)}}const nl={partial:!0,tokenize:hS};function hS(e,n,s){return r;function r(o){return Be(o)?Ue(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Pe(o)?n(o):s(o)}}const bv={continuation:{tokenize:fS},exit:mS,name:"blockQuote",tokenize:pS};function pS(e,n,s){const r=this;return i;function i(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return s(l)}function o(l){return Be(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function fS(e,n,s){const r=this;return i;function i(l){return Be(l)?Ue(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(bv,n,s)(l)}}function mS(e){e.exit("blockQuote")}const wv={name:"characterEscape",tokenize:gS};function gS(e,n,s){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return nS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):s(o)}}const Nv={name:"characterReference",tokenize:xS};function xS(e,n,s){const r=this;let i=0,o,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,l=Ht,f(m))}function p(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=tS,f):(e.enter("characterReferenceValue"),o=7,l=ff,f(m))}function f(m){if(m===59&&i){const x=e.exit("characterReferenceValue");return l===Ht&&!Sm(r.sliceSerialize(x))?s(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(m)&&i++<o?(e.consume(m),f):s(m)}}const Iy={partial:!0,tokenize:jS},Fy={concrete:!0,name:"codeFenced",tokenize:yS};function yS(e,n,s){const r=this,i={partial:!0,tokenize:R};let o=0,l=0,u;return d;function d(E){return p(E)}function p(E){const M=r.events[r.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,u=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===u?(l++,e.consume(E),f):l<3?s(E):(e.exit("codeFencedFenceSequence"),Be(E)?Ue(e,m,"whitespace")(E):m(E))}function m(E){return E===null||Pe(E)?(e.exit("codeFencedFence"),r.interrupt?n(E):e.check(Iy,k,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===null||Pe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(E)):Be(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,y,"whitespace")(E)):E===96&&E===u?s(E):(e.consume(E),x)}function y(E){return E===null||Pe(E)?m(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(E))}function j(E){return E===null||Pe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(E)):E===96&&E===u?s(E):(e.consume(E),j)}function k(E){return e.attempt(i,A,b)(E)}function b(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),S}function S(E){return o>0&&Be(E)?Ue(e,N,"linePrefix",o+1)(E):N(E)}function N(E){return E===null||Pe(E)?e.check(Iy,k,A)(E):(e.enter("codeFlowValue"),$(E))}function $(E){return E===null||Pe(E)?(e.exit("codeFlowValue"),N(E)):(e.consume(E),$)}function A(E){return e.exit("codeFenced"),n(E)}function R(E,M,F){let W=0;return I;function I(G){return E.enter("lineEnding"),E.consume(G),E.exit("lineEnding"),q}function q(G){return E.enter("codeFencedFence"),Be(G)?Ue(E,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):L(G)}function L(G){return G===u?(E.enter("codeFencedFenceSequence"),U(G)):F(G)}function U(G){return G===u?(W++,E.consume(G),U):W>=l?(E.exit("codeFencedFenceSequence"),Be(G)?Ue(E,_,"whitespace")(G):_(G)):F(G)}function _(G){return G===null||Pe(G)?(E.exit("codeFencedFence"),M(G)):F(G)}}}function jS(e,n,s){const r=this;return i;function i(l){return l===null?s(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?s(l):n(l)}}const cp={name:"codeIndented",tokenize:vS},kS={partial:!0,tokenize:bS};function vS(e,n,s){const r=this;return i;function i(p){return e.enter("codeIndented"),Ue(e,o,"linePrefix",5)(p)}function o(p){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(p):s(p)}function l(p){return p===null?d(p):Pe(p)?e.attempt(kS,l,d)(p):(e.enter("codeFlowValue"),u(p))}function u(p){return p===null||Pe(p)?(e.exit("codeFlowValue"),l(p)):(e.consume(p),u)}function d(p){return e.exit("codeIndented"),n(p)}}function bS(e,n,s){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?s(l):Pe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Ue(e,o,"linePrefix",5)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?n(l):Pe(l)?i(l):s(l)}}const wS={name:"codeText",previous:SS,resolve:NS,tokenize:CS};function NS(e){let n=e.length-4,s=3,r,i;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=s;++r<n;)if(e[r][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(r=s-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function SS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CS(e,n,s){let r=0,i,o;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?s(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(o=e.enter("codeTextSequence"),i=0,f(m)):Pe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),p(m))}function p(m){return m===null||m===32||m===96||Pe(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),p)}function f(m){return m===96?(e.consume(m),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",p(m))}}class $S{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,s){const r=s??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,s,r){const i=s||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&eo(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),eo(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),eo(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const s=this.left.splice(n,Number.POSITIVE_INFINITY);eo(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);eo(this.left,s.reverse())}}}function eo(e,n){let s=0;if(n.length<1e4)e.push(...n);else for(;s<n.length;)e.push(...n.slice(s,s+1e4)),s+=1e4}function Sv(e){const n={};let s=-1,r,i,o,l,u,d,p;const f=new $S(e);for(;++s<f.length;){for(;s in n;)s=n[s];if(r=f.get(s),s&&r[1].type==="chunkFlow"&&f.get(s-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,TS(f,s)),s=n[s],p=!0);else if(r[1]._container){for(o=s,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},u=f.slice(i,s),u.unshift(r),f.splice(i,s-i+1,u))}}return Nn(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!p}function TS(e,n){const s=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=s._tokenizer;l||(l=r.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],p={};let f,m,x=-1,y=s,j=0,k=0;const b=[k];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(f=r.sliceStream(y),y.next||f.push(null),m&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=s;++x<u.length;)u[x][0]==="exit"&&u[x-1][0]==="enter"&&u[x][1].type===u[x-1][1].type&&u[x][1].start.line!==u[x][1].end.line&&(k=x+1,b.push(k),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):b.pop(),x=b.length;x--;){const S=u.slice(b[x],b[x+1]),N=o.pop();d.push([N,N+S.length-1]),e.splice(N,2,S)}for(d.reverse(),x=-1;++x<d.length;)p[j+d[x][0]]=j+d[x][1],j+=d[x][1]-d[x][0]-1;return p}const ES={resolve:PS,tokenize:RS},AS={partial:!0,tokenize:IS};function PS(e){return Sv(e),e}function RS(e,n){let s;return r;function r(u){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?o(u):Pe(u)?e.check(AS,l,o)(u):(e.consume(u),i)}function o(u){return e.exit("chunkContent"),e.exit("content"),n(u)}function l(u){return e.consume(u),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,i}}function IS(e,n,s){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ue(e,o,"linePrefix")}function o(l){if(l===null||Pe(l))return s(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,s,n)(l)}}function Cv(e,n,s,r,i,o,l,u,d){const p=d||Number.POSITIVE_INFINITY;let f=0;return m;function m(S){return S===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(S),e.exit(o),x):S===null||S===32||S===41||cu(S)?s(S):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),k(S))}function x(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(u),x(S)):S===null||S===60||Pe(S)?s(S):(e.consume(S),S===92?j:y)}function j(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function k(S){return!f&&(S===null||S===41||et(S))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),n(S)):f<p&&S===40?(e.consume(S),f++,k):S===41?(e.consume(S),f--,k):S===null||S===32||S===40||cu(S)?s(S):(e.consume(S),S===92?b:k)}function b(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function $v(e,n,s,r,i,o){const l=this;let u=0,d;return p;function p(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),f}function f(y){return u>999||y===null||y===91||y===93&&!d||y===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?s(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),n):Pe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||Pe(y)||u++>999?(e.exit("chunkString"),f(y)):(e.consume(y),d||(d=!Be(y)),y===92?x:m)}function x(y){return y===91||y===92||y===93?(e.consume(y),u++,m):m(y)}}function Tv(e,n,s,r,i,o){let l;return u;function u(x){return x===34||x===39||x===40?(e.enter(r),e.enter(i),e.consume(x),e.exit(i),l=x===40?41:x,d):s(x)}function d(x){return x===l?(e.enter(i),e.consume(x),e.exit(i),e.exit(r),n):(e.enter(o),p(x))}function p(x){return x===l?(e.exit(o),d(l)):x===null?s(x):Pe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ue(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(x))}function f(x){return x===l||x===null||Pe(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?m:f)}function m(x){return x===l||x===92?(e.consume(x),f):f(x)}}function lo(e,n){let s;return r;function r(i){return Pe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s=!0,r):Be(i)?Ue(e,r,s?"linePrefix":"lineSuffix")(i):n(i)}}const FS={name:"definition",tokenize:LS},zS={partial:!0,tokenize:MS};function LS(e,n,s){const r=this;let i;return o;function o(y){return e.enter("definition"),l(y)}function l(y){return $v.call(r,e,u,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return i=rs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):s(y)}function d(y){return et(y)?lo(e,p)(y):p(y)}function p(y){return Cv(e,f,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function f(y){return e.attempt(zS,m,m)(y)}function m(y){return Be(y)?Ue(e,x,"whitespace")(y):x(y)}function x(y){return y===null||Pe(y)?(e.exit("definition"),r.parser.defined.push(i),n(y)):s(y)}}function MS(e,n,s){return r;function r(u){return et(u)?lo(e,i)(u):s(u)}function i(u){return Tv(e,o,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return Be(u)?Ue(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Pe(u)?n(u):s(u)}}const qS={name:"hardBreakEscape",tokenize:OS};function OS(e,n,s){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Pe(o)?(e.exit("hardBreakEscape"),n(o)):s(o)}}const _S={name:"headingAtx",resolve:DS,tokenize:BS};function DS(e,n){let s=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),s-2>r&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(r===s-1||s-4>r&&e[s-2][1].type==="whitespace")&&(s-=r+1===s?2:4),s>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[s][1].end},o={type:"chunkText",start:e[r][1].start,end:e[s][1].end,contentType:"text"},Nn(e,r,s-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function BS(e,n,s){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||et(f)?(e.exit("atxHeadingSequence"),u(f)):s(f)}function u(f){return f===35?(e.enter("atxHeadingSequence"),d(f)):f===null||Pe(f)?(e.exit("atxHeading"),n(f)):Be(f)?Ue(e,u,"whitespace")(f):(e.enter("atxHeadingText"),p(f))}function d(f){return f===35?(e.consume(f),d):(e.exit("atxHeadingSequence"),u(f))}function p(f){return f===null||f===35||et(f)?(e.exit("atxHeadingText"),u(f)):(e.consume(f),p)}}const WS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zy=["pre","script","style","textarea"],US={concrete:!0,name:"htmlFlow",resolveTo:KS,tokenize:YS},HS={partial:!0,tokenize:QS},VS={partial:!0,tokenize:GS};function KS(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function YS(e,n,s){const r=this;let i,o,l,u,d;return p;function p(z){return f(z)}function f(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),m}function m(z){return z===33?(e.consume(z),x):z===47?(e.consume(z),o=!0,k):z===63?(e.consume(z),i=3,r.interrupt?n:P):en(z)?(e.consume(z),l=String.fromCharCode(z),b):s(z)}function x(z){return z===45?(e.consume(z),i=2,y):z===91?(e.consume(z),i=5,u=0,j):en(z)?(e.consume(z),i=4,r.interrupt?n:P):s(z)}function y(z){return z===45?(e.consume(z),r.interrupt?n:P):s(z)}function j(z){const ye="CDATA[";return z===ye.charCodeAt(u++)?(e.consume(z),u===ye.length?r.interrupt?n:L:j):s(z)}function k(z){return en(z)?(e.consume(z),l=String.fromCharCode(z),b):s(z)}function b(z){if(z===null||z===47||z===62||et(z)){const ye=z===47,fe=l.toLowerCase();return!ye&&!o&&zy.includes(fe)?(i=1,r.interrupt?n(z):L(z)):WS.includes(l.toLowerCase())?(i=6,ye?(e.consume(z),S):r.interrupt?n(z):L(z)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?s(z):o?N(z):$(z))}return z===45||Ht(z)?(e.consume(z),l+=String.fromCharCode(z),b):s(z)}function S(z){return z===62?(e.consume(z),r.interrupt?n:L):s(z)}function N(z){return Be(z)?(e.consume(z),N):I(z)}function $(z){return z===47?(e.consume(z),I):z===58||z===95||en(z)?(e.consume(z),A):Be(z)?(e.consume(z),$):I(z)}function A(z){return z===45||z===46||z===58||z===95||Ht(z)?(e.consume(z),A):R(z)}function R(z){return z===61?(e.consume(z),E):Be(z)?(e.consume(z),R):$(z)}function E(z){return z===null||z===60||z===61||z===62||z===96?s(z):z===34||z===39?(e.consume(z),d=z,M):Be(z)?(e.consume(z),E):F(z)}function M(z){return z===d?(e.consume(z),d=null,W):z===null||Pe(z)?s(z):(e.consume(z),M)}function F(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||et(z)?R(z):(e.consume(z),F)}function W(z){return z===47||z===62||Be(z)?$(z):s(z)}function I(z){return z===62?(e.consume(z),q):s(z)}function q(z){return z===null||Pe(z)?L(z):Be(z)?(e.consume(z),q):s(z)}function L(z){return z===45&&i===2?(e.consume(z),le):z===60&&i===1?(e.consume(z),V):z===62&&i===4?(e.consume(z),B):z===63&&i===3?(e.consume(z),P):z===93&&i===5?(e.consume(z),te):Pe(z)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(HS,J,U)(z)):z===null||Pe(z)?(e.exit("htmlFlowData"),U(z)):(e.consume(z),L)}function U(z){return e.check(VS,_,J)(z)}function _(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),G}function G(z){return z===null||Pe(z)?U(z):(e.enter("htmlFlowData"),L(z))}function le(z){return z===45?(e.consume(z),P):L(z)}function V(z){return z===47?(e.consume(z),l="",Y):L(z)}function Y(z){if(z===62){const ye=l.toLowerCase();return zy.includes(ye)?(e.consume(z),B):L(z)}return en(z)&&l.length<8?(e.consume(z),l+=String.fromCharCode(z),Y):L(z)}function te(z){return z===93?(e.consume(z),P):L(z)}function P(z){return z===62?(e.consume(z),B):z===45&&i===2?(e.consume(z),P):L(z)}function B(z){return z===null||Pe(z)?(e.exit("htmlFlowData"),J(z)):(e.consume(z),B)}function J(z){return e.exit("htmlFlow"),n(z)}}function GS(e,n,s){const r=this;return i;function i(l){return Pe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):s(l)}function o(l){return r.parser.lazy[r.now().line]?s(l):n(l)}}function QS(e,n,s){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(nl,n,s)}}const ZS={name:"htmlText",tokenize:XS};function XS(e,n,s){const r=this;let i,o,l;return u;function u(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),d}function d(P){return P===33?(e.consume(P),p):P===47?(e.consume(P),R):P===63?(e.consume(P),$):en(P)?(e.consume(P),F):s(P)}function p(P){return P===45?(e.consume(P),f):P===91?(e.consume(P),o=0,j):en(P)?(e.consume(P),N):s(P)}function f(P){return P===45?(e.consume(P),y):s(P)}function m(P){return P===null?s(P):P===45?(e.consume(P),x):Pe(P)?(l=m,V(P)):(e.consume(P),m)}function x(P){return P===45?(e.consume(P),y):m(P)}function y(P){return P===62?le(P):P===45?x(P):m(P)}function j(P){const B="CDATA[";return P===B.charCodeAt(o++)?(e.consume(P),o===B.length?k:j):s(P)}function k(P){return P===null?s(P):P===93?(e.consume(P),b):Pe(P)?(l=k,V(P)):(e.consume(P),k)}function b(P){return P===93?(e.consume(P),S):k(P)}function S(P){return P===62?le(P):P===93?(e.consume(P),S):k(P)}function N(P){return P===null||P===62?le(P):Pe(P)?(l=N,V(P)):(e.consume(P),N)}function $(P){return P===null?s(P):P===63?(e.consume(P),A):Pe(P)?(l=$,V(P)):(e.consume(P),$)}function A(P){return P===62?le(P):$(P)}function R(P){return en(P)?(e.consume(P),E):s(P)}function E(P){return P===45||Ht(P)?(e.consume(P),E):M(P)}function M(P){return Pe(P)?(l=M,V(P)):Be(P)?(e.consume(P),M):le(P)}function F(P){return P===45||Ht(P)?(e.consume(P),F):P===47||P===62||et(P)?W(P):s(P)}function W(P){return P===47?(e.consume(P),le):P===58||P===95||en(P)?(e.consume(P),I):Pe(P)?(l=W,V(P)):Be(P)?(e.consume(P),W):le(P)}function I(P){return P===45||P===46||P===58||P===95||Ht(P)?(e.consume(P),I):q(P)}function q(P){return P===61?(e.consume(P),L):Pe(P)?(l=q,V(P)):Be(P)?(e.consume(P),q):W(P)}function L(P){return P===null||P===60||P===61||P===62||P===96?s(P):P===34||P===39?(e.consume(P),i=P,U):Pe(P)?(l=L,V(P)):Be(P)?(e.consume(P),L):(e.consume(P),_)}function U(P){return P===i?(e.consume(P),i=void 0,G):P===null?s(P):Pe(P)?(l=U,V(P)):(e.consume(P),U)}function _(P){return P===null||P===34||P===39||P===60||P===61||P===96?s(P):P===47||P===62||et(P)?W(P):(e.consume(P),_)}function G(P){return P===47||P===62||et(P)?W(P):s(P)}function le(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),n):s(P)}function V(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),Y}function Y(P){return Be(P)?Ue(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):te(P)}function te(P){return e.enter("htmlTextData"),l(P)}}const Cm={name:"labelEnd",resolveAll:nC,resolveTo:sC,tokenize:rC},JS={tokenize:iC},eC={tokenize:aC},tC={tokenize:oC};function nC(e){let n=-1;const s=[];for(;++n<e.length;){const r=e[n][1];if(s.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==s.length&&Nn(e,0,e.length,s),e}function sC(e,n){let s=e.length,r=0,i,o,l,u;for(;s--;)if(i=e[s][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[s][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[s][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=s,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=s);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,n],["enter",p,n]],u=On(u,e.slice(o+1,o+r+3)),u=On(u,[["enter",f,n]]),u=On(u,Mu(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),u=On(u,[["exit",f,n],e[l-2],e[l-1],["exit",p,n]]),u=On(u,e.slice(l+1)),u=On(u,[["exit",d,n]]),Nn(e,o,e.length,u),e}function rC(e,n,s){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return u;function u(x){return o?o._inactive?m(x):(l=r.parser.defined.includes(rs(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),d):s(x)}function d(x){return x===40?e.attempt(JS,f,l?f:m)(x):x===91?e.attempt(eC,f,l?p:m)(x):l?f(x):m(x)}function p(x){return e.attempt(tC,f,m)(x)}function f(x){return n(x)}function m(x){return o._balanced=!0,s(x)}}function iC(e,n,s){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return et(m)?lo(e,o)(m):o(m)}function o(m){return m===41?f(m):Cv(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return et(m)?lo(e,d)(m):f(m)}function u(m){return s(m)}function d(m){return m===34||m===39||m===40?Tv(e,p,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):f(m)}function p(m){return et(m)?lo(e,f)(m):f(m)}function f(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):s(m)}}function aC(e,n,s){const r=this;return i;function i(u){return $v.call(r,e,o,l,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(rs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(u):s(u)}function l(u){return s(u)}}function oC(e,n,s){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):s(o)}}const lC={name:"labelStartImage",resolveAll:Cm.resolveAll,tokenize:cC};function cC(e,n,s){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):s(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(u):n(u)}}const uC={name:"labelStartLink",resolveAll:Cm.resolveAll,tokenize:dC};function dC(e,n,s){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(l):n(l)}}const up={name:"lineEnding",tokenize:hC};function hC(e,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ue(e,n,"linePrefix")}}const Dc={name:"thematicBreak",tokenize:pC};function pC(e,n,s){let r=0,i;return o;function o(p){return e.enter("thematicBreak"),l(p)}function l(p){return i=p,u(p)}function u(p){return p===i?(e.enter("thematicBreakSequence"),d(p)):r>=3&&(p===null||Pe(p))?(e.exit("thematicBreak"),n(p)):s(p)}function d(p){return p===i?(e.consume(p),r++,d):(e.exit("thematicBreakSequence"),Be(p)?Ue(e,u,"whitespace")(p):u(p))}}const cn={continuation:{tokenize:xC},exit:jC,name:"list",tokenize:gC},fC={partial:!0,tokenize:kC},mC={partial:!0,tokenize:yC};function gC(e,n,s){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return u;function u(y){const j=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:ff(y)){if(r.containerState.type||(r.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Dc,s,p)(y):p(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return s(y)}function d(y){return ff(y)&&++l<10?(e.consume(y),d):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),p(y)):s(y)}function p(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(nl,r.interrupt?s:f,e.attempt(fC,x,m))}function f(y){return r.containerState.initialBlankLine=!0,o++,x(y)}function m(y){return Be(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):s(y)}function x(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(y)}}function xC(e,n,s){const r=this;return r.containerState._closeFlow=void 0,e.check(nl,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ue(e,n,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!Be(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mC,n,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ue(e,e.attempt(cn,n,s),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function yC(e,n,s){const r=this;return Ue(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):s(o)}}function jC(e){e.exit(this.containerState.type)}function kC(e,n,s){const r=this;return Ue(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!Be(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):s(o)}}const Ly={name:"setextUnderline",resolveTo:vC,tokenize:bC};function vC(e,n){let s=e.length,r,i,o;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(i=s)}else e[s][1].type==="content"&&e.splice(s,1),!o&&e[s][1].type==="definition"&&(o=s);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function bC(e,n,s){const r=this;let i;return o;function o(p){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=p,l(p)):s(p)}function l(p){return e.enter("setextHeadingLineSequence"),u(p)}function u(p){return p===i?(e.consume(p),u):(e.exit("setextHeadingLineSequence"),Be(p)?Ue(e,d,"lineSuffix")(p):d(p))}function d(p){return p===null||Pe(p)?(e.exit("setextHeadingLine"),n(p)):s(p)}}const wC={tokenize:NC};function NC(e){const n=this,s=e.attempt(nl,r,e.attempt(this.parser.constructs.flowInitial,i,Ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ES,i)),"linePrefix")));return s;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,s}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,s}}const SC={resolveAll:Av()},CC=Ev("string"),$C=Ev("text");function Ev(e){return{resolveAll:Av(e==="text"?TC:void 0),tokenize:n};function n(s){const r=this,i=this.parser.constructs[e],o=s.attempt(i,l,u);return l;function l(f){return p(f)?o(f):u(f)}function u(f){if(f===null){s.consume(f);return}return s.enter("data"),s.consume(f),d}function d(f){return p(f)?(s.exit("data"),o(f)):(s.consume(f),d)}function p(f){if(f===null)return!0;const m=i[f];let x=-1;if(m)for(;++x<m.length;){const y=m[x];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Av(e){return n;function n(s,r){let i=-1,o;for(;++i<=s.length;)o===void 0?s[i]&&s[i][1].type==="data"&&(o=i,i++):(!s[i]||s[i][1].type!=="data")&&(i!==o+2&&(s[o][1].end=s[i-1][1].end,s.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(s,r):s}}function TC(e,n){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],i=n.sliceStream(r);let o=i.length,l=-1,u=0,d;for(;o--;){const p=i[o];if(typeof p=="string"){for(l=p.length;p.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(p===-2)d=!0,u++;else if(p!==-1){o++;break}}if(n._contentTypeTextTrailing&&s===e.length&&(u=0),u){const p={type:s===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...p.start},r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(s,0,["enter",p,n],["exit",p,n]),s+=2)}s++}return e}const EC={42:cn,43:cn,45:cn,48:cn,49:cn,50:cn,51:cn,52:cn,53:cn,54:cn,55:cn,56:cn,57:cn,62:bv},AC={91:FS},PC={[-2]:cp,[-1]:cp,32:cp},RC={35:_S,42:Dc,45:[Ly,Dc],60:US,61:Ly,95:Dc,96:Fy,126:Fy},IC={38:Nv,92:wv},FC={[-5]:up,[-4]:up,[-3]:up,33:lC,38:Nv,42:mf,60:[uS,ZS],91:uC,92:[qS,wv],93:Cm,95:mf,96:wS},zC={null:[mf,SC]},LC={null:[42,95]},MC={null:[]},qC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LC,contentInitial:AC,disable:MC,document:EC,flow:RC,flowInitial:PC,insideSpan:zC,string:IC,text:FC},Symbol.toStringTag,{value:"Module"}));function OC(e,n,s){let r={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const i={},o=[];let l=[],u=[];const d={attempt:M(R),check:M(E),consume:N,enter:$,exit:A,interrupt:M(E,{interrupt:!0})},p={code:null,containerState:{},defineSkip:k,events:[],now:j,parser:e,previous:null,sliceSerialize:x,sliceStream:y,write:m};let f=n.tokenize.call(p,d);return n.resolveAll&&o.push(n),p;function m(q){return l=On(l,q),b(),l[l.length-1]!==null?[]:(F(n,0),p.events=Mu(o,p.events,p),p.events)}function x(q,L){return DC(y(q),L)}function y(q){return _C(l,q)}function j(){const{_bufferIndex:q,_index:L,line:U,column:_,offset:G}=r;return{_bufferIndex:q,_index:L,line:U,column:_,offset:G}}function k(q){i[q.line]=q.column,I()}function b(){let q;for(;r._index<l.length;){const L=l[r._index];if(typeof L=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<L.length;)S(L.charCodeAt(r._bufferIndex));else S(L)}}function S(q){f=f(q)}function N(q){Pe(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,I()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),p.previous=q}function $(q,L){const U=L||{};return U.type=q,U.start=j(),p.events.push(["enter",U,p]),u.push(U),U}function A(q){const L=u.pop();return L.end=j(),p.events.push(["exit",L,p]),L}function R(q,L){F(q,L.from)}function E(q,L){L.restore()}function M(q,L){return U;function U(_,G,le){let V,Y,te,P;return Array.isArray(_)?J(_):"tokenize"in _?J([_]):B(_);function B(ve){return Fe;function Fe(Ie){const Re=Ie!==null&&ve[Ie],Je=Ie!==null&&ve.null,Ot=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(Je)?Je:Je?[Je]:[]];return J(Ot)(Ie)}}function J(ve){return V=ve,Y=0,ve.length===0?le:z(ve[Y])}function z(ve){return Fe;function Fe(Ie){return P=W(),te=ve,ve.partial||(p.currentConstruct=ve),ve.name&&p.parser.constructs.disable.null.includes(ve.name)?fe():ve.tokenize.call(L?Object.assign(Object.create(p),L):p,d,ye,fe)(Ie)}}function ye(ve){return q(te,P),G}function fe(ve){return P.restore(),++Y<V.length?z(V[Y]):le}}}function F(q,L){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Nn(p.events,L,p.events.length-L,q.resolve(p.events.slice(L),p)),q.resolveTo&&(p.events=q.resolveTo(p.events,p))}function W(){const q=j(),L=p.previous,U=p.currentConstruct,_=p.events.length,G=Array.from(u);return{from:_,restore:le};function le(){r=q,p.previous=L,p.currentConstruct=U,p.events.length=_,u=G,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function _C(e,n){const s=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(s===i)l=[e[s].slice(r,o)];else{if(l=e.slice(s,i),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function DC(e,n){let s=-1;const r=[];let i;for(;++s<e.length;){const o=e[s];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
585
+ `;break}case-3:{l=`\r
586
+ `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function BC(e){const r={constructs:kv([qC,...(e||{}).extensions||[]]),content:i(sS),defined:[],document:i(iS),flow:i(wC),lazy:{},string:i(CC),text:i($C)};return r;function i(o){return l;function l(u){return OC(r,o,u)}}}function WC(e){for(;!Sv(e););return e}const My=/[\0\t\n\r]/g;function UC(){let e=1,n="",s=!0,r;return i;function i(o,l,u){const d=[];let p,f,m,x,y;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),m=0,n="",s&&(o.charCodeAt(0)===65279&&m++,s=void 0);m<o.length;){if(My.lastIndex=m,p=My.exec(o),x=p&&p.index!==void 0?p.index:o.length,y=o.charCodeAt(x),!p){n=o.slice(m);break}if(y===10&&m===x&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<x&&(d.push(o.slice(m,x)),e+=x-m),y){case 0:{d.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,d.push(-2);e++<f;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return u&&(r&&d.push(-5),n&&d.push(n),d.push(null)),d}}const HC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VC(e){return e.replace(HC,KC)}function KC(e,n,s){if(n)return n;if(s.charCodeAt(0)===35){const i=s.charCodeAt(1),o=i===120||i===88;return vv(s.slice(o?2:1),o?16:10)}return Sm(s)||e}const Pv={}.hasOwnProperty;function YC(e,n,s){return n&&typeof n=="object"&&(s=n,n=void 0),GC(s)(WC(BC(s).document().write(UC()(e,n,!0))))}function GC(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(mn),autolinkProtocol:W,autolinkEmail:W,atxHeading:o(Tn),blockQuote:o(Je),characterEscape:W,characterReference:W,codeFenced:o(Ot),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ot,l),codeText:o($n,l),codeTextData:W,data:W,codeFlowValue:W,definition:o(gt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Zt),hardBreakEscape:o(En),hardBreakTrailing:o(En),htmlFlow:o(Vn,l),htmlFlowData:W,htmlText:o(Vn,l),htmlTextData:W,image:o(Pt),label:l,link:o(mn),listItem:o(An),listItemValue:x,listOrdered:o(Ct,m),listUnordered:o(Ct),paragraph:o(Pn),reference:z,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Tn),strong:o(Hs),thematicBreak:o(Ge)},exit:{atxHeading:d(),atxHeadingSequence:R,autolink:d(),autolinkEmail:Re,autolinkProtocol:Ie,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ve,characterReference:Fe,codeFenced:d(b),codeFencedFence:k,codeFencedFenceInfo:y,codeFencedFenceMeta:j,codeFlowValue:I,codeIndented:d(S),codeText:d(G),codeTextData:I,data:I,definition:d(),definitionDestinationString:A,definitionLabelString:N,definitionTitleString:$,emphasis:d(),hardBreakEscape:d(L),hardBreakTrailing:d(L),htmlFlow:d(U),htmlFlowData:I,htmlText:d(_),htmlTextData:I,image:d(V),label:te,labelText:Y,lineEnding:q,link:d(le),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ye,resourceDestinationString:P,resourceTitleString:B,resource:J,setextHeading:d(F),setextHeadingLineSequence:M,setextHeadingText:E,strong:d(),thematicBreak:d()}};Rv(n,(e||{}).mdastExtensions||[]);const s={};return r;function r(ee){let ue={type:"root",children:[]};const Te={stack:[ue],tokenStack:[],config:n,enter:u,exit:p,buffer:l,resume:f,data:s},Oe=[];let We=-1;for(;++We<ee.length;)if(ee[We][1].type==="listOrdered"||ee[We][1].type==="listUnordered")if(ee[We][0]==="enter")Oe.push(We);else{const kt=Oe.pop();We=i(ee,kt,We)}for(We=-1;++We<ee.length;){const kt=n[ee[We][0]];Pv.call(kt,ee[We][1].type)&&kt[ee[We][1].type].call(Object.assign({sliceSerialize:ee[We][2].sliceSerialize},Te),ee[We][1])}if(Te.tokenStack.length>0){const kt=Te.tokenStack[Te.tokenStack.length-1];(kt[1]||qy).call(Te,void 0,kt[0])}for(ue.position={start:dr(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:dr(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<n.transforms.length;)ue=n.transforms[We](ue)||ue;return ue}function i(ee,ue,Te){let Oe=ue-1,We=-1,kt=!1,Rn,tn,se,Ze;for(;++Oe<=Te;){const st=ee[Oe];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?We++:We--,Ze=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Rn&&!Ze&&!We&&!se&&(se=Oe),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!We&&st[0]==="enter"&&st[1].type==="listItemPrefix"||We===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(Rn){let xt=Oe;for(tn=void 0;xt--;){const ct=ee[xt];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;tn&&(ee[tn][1].type="lineEndingBlank",kt=!0),ct[1].type="lineEnding",tn=xt}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}se&&(!tn||se<tn)&&(Rn._spread=!0),Rn.end=Object.assign({},tn?ee[tn][1].start:st[1].end),ee.splice(tn||Oe,0,["exit",Rn,st[2]]),Oe++,Te++}if(st[1].type==="listItemPrefix"){const xt={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Rn=xt,ee.splice(Oe,0,["enter",xt,st[2]]),Oe++,Te++,se=void 0,Ze=!0}}}return ee[ue][1]._spread=kt,Te}function o(ee,ue){return Te;function Te(Oe){u.call(this,ee(Oe),Oe),ue&&ue.call(this,Oe)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ee,ue,Te){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([ue,Te||void 0]),ee.position={start:dr(ue.start),end:void 0}}function d(ee){return ue;function ue(Te){ee&&ee.call(this,Te),p.call(this,Te)}}function p(ee,ue){const Te=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==ee.type&&(ue?ue.call(this,ee,Oe[0]):(Oe[1]||qy).call(this,ee,Oe[0]));else throw new Error("Cannot close `"+ee.type+"` ("+oo({start:ee.start,end:ee.end})+"): it’s not open");Te.position.end=dr(ee.end)}function f(){return Nm(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(ee){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=ee}function j(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=ee}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.value=ee.replace(/(\r?\n|\r)$/g,"")}function N(ee){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ue,Te.identifier=rs(this.sliceSerialize(ee)).toLowerCase()}function $(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.title=ee}function A(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.url=ee}function R(ee){const ue=this.stack[this.stack.length-1];if(!ue.depth){const Te=this.sliceSerialize(ee).length;ue.depth=Te}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function M(ee){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function W(ee){const Te=this.stack[this.stack.length-1].children;let Oe=Te[Te.length-1];(!Oe||Oe.type!=="text")&&(Oe=ls(),Oe.position={start:dr(ee.start),end:void 0},Te.push(Oe)),this.stack.push(Oe)}function I(ee){const ue=this.stack.pop();ue.value+=this.sliceSerialize(ee),ue.position.end=dr(ee.end)}function q(ee){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ue.children[ue.children.length-1];Te.position.end=dr(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(ue.type)&&(W.call(this,ee),I.call(this,ee))}function L(){this.data.atHardBreak=!0}function U(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.value=ee}function _(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.value=ee}function G(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.value=ee}function le(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ue,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function V(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ue,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function Y(ee){const ue=this.sliceSerialize(ee),Te=this.stack[this.stack.length-2];Te.label=VC(ue),Te.identifier=rs(ue).toLowerCase()}function te(){const ee=this.stack[this.stack.length-1],ue=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Oe=ee.children;Te.children=Oe}else Te.alt=ue}function P(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.url=ee}function B(){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.title=ee}function J(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function ye(ee){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ue,Te.identifier=rs(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function fe(ee){this.data.characterReferenceType=ee.type}function ve(ee){const ue=this.sliceSerialize(ee),Te=this.data.characterReferenceType;let Oe;Te?(Oe=vv(ue,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=Sm(ue);const We=this.stack[this.stack.length-1];We.value+=Oe}function Fe(ee){const ue=this.stack.pop();ue.position.end=dr(ee.end)}function Ie(ee){I.call(this,ee);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(ee)}function Re(ee){I.call(this,ee);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(ee)}function Je(){return{type:"blockquote",children:[]}}function Ot(){return{type:"code",lang:null,meta:null,value:""}}function $n(){return{type:"inlineCode",value:""}}function gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Zt(){return{type:"emphasis",children:[]}}function Tn(){return{type:"heading",depth:0,children:[]}}function En(){return{type:"break"}}function Vn(){return{type:"html",value:""}}function Pt(){return{type:"image",title:null,url:"",alt:null}}function mn(){return{type:"link",title:null,url:"",children:[]}}function Ct(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function An(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function Pn(){return{type:"paragraph",children:[]}}function Hs(){return{type:"strong",children:[]}}function ls(){return{type:"text",value:""}}function Ge(){return{type:"thematicBreak"}}}function dr(e){return{line:e.line,column:e.column,offset:e.offset}}function Rv(e,n){let s=-1;for(;++s<n.length;){const r=n[s];Array.isArray(r)?Rv(e,r):QC(e,r)}}function QC(e,n){let s;for(s in n)if(Pv.call(n,s))switch(s){case"canContainEols":{const r=n[s];r&&e[s].push(...r);break}case"transforms":{const r=n[s];r&&e[s].push(...r);break}case"enter":case"exit":{const r=n[s];r&&Object.assign(e[s],r);break}}}function qy(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+oo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+oo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+oo({start:n.start,end:n.end})+") is still open")}function ZC(e){const n=this;n.parser=s;function s(r){return YC(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function XC(e,n){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,s),e.applyData(n,s)}function JC(e,n){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,s),[e.applyData(n,s),{type:"text",value:`
587
+ `}]}function e$(e,n){const s=n.value?n.value+`
588
+ `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:s}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function t$(e,n){const s={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function n$(e,n){const s={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function s$(e,n){const s=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=aa(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+i,id:s+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(n,p),e.applyData(n,p)}function r$(e,n){const s={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function i$(e,n){if(e.options.allowDangerousHtml){const s={type:"raw",value:n.value};return e.patch(n,s),e.applyData(n,s)}}function Iv(e,n){const s=n.referenceType;let r="]";if(s==="collapsed"?r+="[]":s==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function a$(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return Iv(e,n);const i={src:aa(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function o$(e,n){const s={src:aa(n.url)};n.alt!==null&&n.alt!==void 0&&(s.alt=n.alt),n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,r),e.applyData(n,r)}function l$(e,n){const s={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,s);const r={type:"element",tagName:"code",properties:{},children:[s]};return e.patch(n,r),e.applyData(n,r)}function c$(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return Iv(e,n);const i={href:aa(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function u$(e,n){const s={href:aa(n.url)};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function d$(e,n,s){const r=e.all(n),i=s?h$(s):Fv(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const f=r[u];(i||u!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
589
+ `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
590
+ `});const p={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,p),e.applyData(n,p)}function h$(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const s=e.children;let r=-1;for(;!n&&++r<s.length;)n=Fv(s[r])}return n}function Fv(e){const n=e.spread;return n??e.children.length>1}function p$(e,n){const s={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(s.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:s,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function f$(e,n){const s={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function m$(e,n){const s={type:"root",children:e.wrap(e.all(n))};return e.patch(n,s),e.applyData(n,s)}function g$(e,n){const s={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function x$(e,n){const s=e.all(n),r=s.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(s.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},u=km(n.children[1]),d=pv(n.children[n.children.length-1]);u&&d&&(l.position={start:u,end:d}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function y$(e,n,s){const r=s?s.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=s&&s.type==="table"?s.align:void 0,u=l?l.length:n.children.length;let d=-1;const p=[];for(;++d<u;){const m=n.children[d],x={},y=l?l[d]:void 0;y&&(x.align=y);let j={type:"element",tagName:o,properties:x,children:[]};m&&(j.children=e.all(m),e.patch(m,j),j=e.applyData(m,j)),p.push(j)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,f),e.applyData(n,f)}function j$(e,n){const s={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}const Oy=9,_y=32;function k$(e){const n=String(e),s=/\r?\n|\r/g;let r=s.exec(n),i=0;const o=[];for(;r;)o.push(Dy(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=s.exec(n);return o.push(Dy(n.slice(i),i>0,!1)),o.join("")}function Dy(e,n,s){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===Oy||o===_y;)r++,o=e.codePointAt(r)}if(s){let o=e.codePointAt(i-1);for(;o===Oy||o===_y;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function v$(e,n){const s={type:"text",value:k$(String(n.value))};return e.patch(n,s),e.applyData(n,s)}function b$(e,n){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,s),e.applyData(n,s)}const w$={blockquote:XC,break:JC,code:e$,delete:t$,emphasis:n$,footnoteReference:s$,heading:r$,html:i$,imageReference:a$,image:o$,inlineCode:l$,linkReference:c$,link:u$,listItem:d$,list:p$,paragraph:f$,root:m$,strong:g$,table:x$,tableCell:j$,tableRow:y$,text:v$,thematicBreak:b$,toml:wc,yaml:wc,definition:wc,footnoteDefinition:wc};function wc(){}const zv=-1,qu=0,co=1,uu=2,$m=3,Tm=4,Em=5,Am=6,Lv=7,Mv=8,By=typeof self=="object"?self:globalThis,N$=(e,n)=>{const s=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case qu:case zv:return s(l,i);case co:{const u=s([],i);for(const d of l)u.push(r(d));return u}case uu:{const u=s({},i);for(const[d,p]of l)u[r(d)]=r(p);return u}case $m:return s(new Date(l),i);case Tm:{const{source:u,flags:d}=l;return s(new RegExp(u,d),i)}case Em:{const u=s(new Map,i);for(const[d,p]of l)u.set(r(d),r(p));return u}case Am:{const u=s(new Set,i);for(const d of l)u.add(r(d));return u}case Lv:{const{name:u,message:d}=l;return s(new By[u](d),i)}case Mv:return s(BigInt(l),i);case"BigInt":return s(Object(BigInt(l)),i);case"ArrayBuffer":return s(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return s(new DataView(u),l)}}return s(new By[o](l),i)};return r},Wy=e=>N$(new Map,e)(0),Li="",{toString:S$}={},{keys:C$}=Object,to=e=>{const n=typeof e;if(n!=="object"||!e)return[qu,n];const s=S$.call(e).slice(8,-1);switch(s){case"Array":return[co,Li];case"Object":return[uu,Li];case"Date":return[$m,Li];case"RegExp":return[Tm,Li];case"Map":return[Em,Li];case"Set":return[Am,Li];case"DataView":return[co,s]}return s.includes("Array")?[co,s]:s.includes("Error")?[Lv,s]:[uu,s]},Nc=([e,n])=>e===qu&&(n==="function"||n==="symbol"),$$=(e,n,s,r)=>{const i=(l,u)=>{const d=r.push(l)-1;return s.set(u,d),d},o=l=>{if(s.has(l))return s.get(l);let[u,d]=to(l);switch(u){case qu:{let f=l;switch(d){case"bigint":u=Mv,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);f=null;break;case"undefined":return i([zv],l)}return i([u,f],l)}case co:{if(d){let x=l;return d==="DataView"?x=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(l)),i([d,[...x]],l)}const f=[],m=i([u,f],l);for(const x of l)f.push(o(x));return m}case uu:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],m=i([u,f],l);for(const x of C$(l))(e||!Nc(to(l[x])))&&f.push([o(x),o(l[x])]);return m}case $m:return i([u,l.toISOString()],l);case Tm:{const{source:f,flags:m}=l;return i([u,{source:f,flags:m}],l)}case Em:{const f=[],m=i([u,f],l);for(const[x,y]of l)(e||!(Nc(to(x))||Nc(to(y))))&&f.push([o(x),o(y)]);return m}case Am:{const f=[],m=i([u,f],l);for(const x of l)(e||!Nc(to(x)))&&f.push(o(x));return m}}const{message:p}=l;return i([u,{name:d,message:p}],l)};return o},Uy=(e,{json:n,lossy:s}={})=>{const r=[];return $$(!(n||s),!!n,new Map,r)(e),r},du=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Wy(Uy(e,n)):structuredClone(e):(e,n)=>Wy(Uy(e,n));function T$(e,n){const s=[{type:"text",value:"↩"}];return n>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),s}function E$(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function A$(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||T$,r=e.options.footnoteBackLabel||E$,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[d]);if(!p)continue;const f=e.all(p),m=String(p.identifier).toUpperCase(),x=aa(m.toLowerCase());let y=0;const j=[],k=e.footnoteCounts.get(m);for(;k!==void 0&&++y<=k;){j.length>0&&j.push({type:"text",value:" "});let N=typeof s=="string"?s:s(d,y);typeof N=="string"&&(N={type:"text",value:N}),j.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,y),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const b=f[f.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const N=b.children[b.children.length-1];N&&N.type==="text"?N.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...j)}else f.push(...j);const S={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(f,!0)};e.patch(p,S),u.push(S)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...du(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
591
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
592
+ `}]}}const sl=(function(e){if(e==null)return F$;if(typeof e=="function")return Ou(e);if(typeof e=="object")return Array.isArray(e)?P$(e):R$(e);if(typeof e=="string")return I$(e);throw new Error("Expected function, string, or object as test")});function P$(e){const n=[];let s=-1;for(;++s<e.length;)n[s]=sl(e[s]);return Ou(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function R$(e){const n=e;return Ou(s);function s(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function I$(e){return Ou(n);function n(s){return s&&s.type===e}}function Ou(e){return n;function n(s,r,i){return!!(z$(s)&&e.call(this,s,typeof r=="number"?r:void 0,i||void 0))}}function F$(){return!0}function z$(e){return e!==null&&typeof e=="object"&&"type"in e}const qv=[],L$=!0,gf=!1,M$="skip";function q$(e,n,s,r){let i;typeof n=="function"&&typeof s!="function"?(r=s,s=n):i=n;const o=sl(i),l=r?-1:1;u(e,void 0,[])();function u(d,p,f){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const y=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return x;function x(){let y=qv,j,k,b;if((!n||o(d,p,f[f.length-1]||void 0))&&(y=O$(s(d,f)),y[0]===gf))return y;if("children"in d&&d.children){const S=d;if(S.children&&y[0]!==M$)for(k=(r?S.children.length:-1)+l,b=f.concat(S);k>-1&&k<S.children.length;){const N=S.children[k];if(j=u(N,k,b)(),j[0]===gf)return j;k=typeof j[1]=="number"?j[1]:k+l}}return y}}}function O$(e){return Array.isArray(e)?e:typeof e=="number"?[L$,e]:e==null?qv:[e]}function Pm(e,n,s,r){let i,o,l;typeof n=="function"&&typeof s!="function"?(o=void 0,l=n,i=s):(o=n,l=s,i=r),q$(e,o,u,i);function u(d,p){const f=p[p.length-1],m=f?f.children.indexOf(d):void 0;return l(d,m,f)}}const xf={}.hasOwnProperty,_$={};function D$(e,n){const s=n||_$,r=new Map,i=new Map,o=new Map,l={...w$,...s.handlers},u={all:p,applyData:W$,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:d,options:s,patch:B$,wrap:H$};return Pm(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const m=f.type==="definition"?r:i,x=String(f.identifier).toUpperCase();m.has(x)||m.set(x,f)}}),u;function d(f,m){const x=f.type,y=u.handlers[x];if(xf.call(u.handlers,x)&&y)return y(u,f,m);if(u.options.passThrough&&u.options.passThrough.includes(x)){if("children"in f){const{children:k,...b}=f,S=du(b);return S.children=u.all(f),S}return du(f)}return(u.options.unknownHandler||U$)(u,f,m)}function p(f){const m=[];if("children"in f){const x=f.children;let y=-1;for(;++y<x.length;){const j=u.one(x[y],f);if(j){if(y&&x[y-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=Hy(j.value)),!Array.isArray(j)&&j.type==="element")){const k=j.children[0];k&&k.type==="text"&&(k.value=Hy(k.value))}Array.isArray(j)?m.push(...j):m.push(j)}}}return m}}function B$(e,n){e.position&&(n.position=E9(e))}function W$(e,n){let s=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(s.type==="element")s.tagName=r;else{const l="children"in s?s.children:[s];s={type:"element",tagName:r,properties:{},children:l}}s.type==="element"&&o&&Object.assign(s.properties,du(o)),"children"in s&&s.children&&i!==null&&i!==void 0&&(s.children=i)}return s}function U$(e,n){const s=n.data||{},r="value"in n&&!(xf.call(s,"hProperties")||xf.call(s,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function H$(e,n){const s=[];let r=-1;for(n&&s.push({type:"text",value:`
593
+ `});++r<e.length;)r&&s.push({type:"text",value:`
594
+ `}),s.push(e[r]);return n&&e.length>0&&s.push({type:"text",value:`
595
+ `}),s}function Hy(e){let n=0,s=e.charCodeAt(n);for(;s===9||s===32;)n++,s=e.charCodeAt(n);return e.slice(n)}function Vy(e,n){const s=D$(e,n),r=s.one(e,void 0),i=A$(s),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
596
+ `},i),o}function V$(e,n){return e&&"run"in e?async function(s,r){const i=Vy(s,{file:r,...n});await e.run(i,r)}:function(s,r){return Vy(s,{file:r,...e||n})}}function Ky(e){if(e)throw e}var dp,Yy;function K$(){if(Yy)return dp;Yy=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},o=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var f=e.call(p,"constructor"),m=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!f&&!m)return!1;var x;for(x in p);return typeof x>"u"||e.call(p,x)},l=function(p,f){s&&f.name==="__proto__"?s(p,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):p[f.name]=f.newValue},u=function(p,f){if(f==="__proto__")if(e.call(p,f)){if(r)return r(p,f).value}else return;return p[f]};return dp=function d(){var p,f,m,x,y,j,k=arguments[0],b=1,S=arguments.length,N=!1;for(typeof k=="boolean"&&(N=k,k=arguments[1]||{},b=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});b<S;++b)if(p=arguments[b],p!=null)for(f in p)m=u(k,f),x=u(p,f),k!==x&&(N&&x&&(o(x)||(y=i(x)))?(y?(y=!1,j=m&&i(m)?m:[]):j=m&&o(m)?m:{},l(k,{name:f,newValue:d(N,j,x)})):typeof x<"u"&&l(k,{name:f,newValue:x}));return k},dp}var Y$=K$();const hp=qf(Y$);function yf(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function G$(){const e=[],n={run:s,use:r};return n;function s(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...i);function u(d,...p){const f=e[++o];let m=-1;if(d){l(d);return}for(;++m<i.length;)(p[m]===null||p[m]===void 0)&&(p[m]=i[m]);i=p,f?Q$(f,u)(...p):l(null,...p)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Q$(e,n){let s;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(i);try{d=e.apply(this,l)}catch(p){const f=p;if(u&&s)throw f;return i(f)}u||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(l,...u){s||(s=!0,n(l,...u))}function o(l){i(null,l)}}const fs={basename:Z$,dirname:X$,extname:J$,join:eT,sep:"/"};function Z$(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');rl(e);let s=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){s=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(s,r)}if(n===e)return"";let l=-1,u=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){s=i+1;break}}else l<0&&(o=!0,l=i+1),u>-1&&(e.codePointAt(i)===n.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return s===r?r=l:r<0&&(r=e.length),e.slice(s,r)}function X$(e){if(rl(e),e.length===0)return".";let n=-1,s=e.length,r;for(;--s;)if(e.codePointAt(s)===47){if(r){n=s;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function J$(e){rl(e);let n=e.length,s=-1,r=0,i=-1,o=0,l;for(;n--;){const u=e.codePointAt(n);if(u===47){if(l){r=n+1;break}continue}s<0&&(l=!0,s=n+1),u===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||s<0||o===0||o===1&&i===s-1&&i===r+1?"":e.slice(i,s)}function eT(...e){let n=-1,s;for(;++n<e.length;)rl(e[n]),e[n]&&(s=s===void 0?e[n]:s+"/"+e[n]);return s===void 0?".":tT(s)}function tT(e){rl(e);const n=e.codePointAt(0)===47;let s=nT(e,!n);return s.length===0&&!n&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),n?"/"+s:s}function nT(e,n){let s="",r=0,i=-1,o=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(s.length<2||r!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(d=s.lastIndexOf("/"),d!==s.length-1){d<0?(s="",r=0):(s=s.slice(0,d),r=s.length-1-s.lastIndexOf("/")),i=l,o=0;continue}}else if(s.length>0){s="",r=0,i=l,o=0;continue}}n&&(s=s.length>0?s+"/..":"..",r=2)}else s.length>0?s+="/"+e.slice(i+1,l):s=e.slice(i+1,l),r=l-i-1;i=l,o=0}else u===46&&o>-1?o++:o=-1}return s}function rl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const sT={cwd:rT};function rT(){return"/"}function jf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iT(e){if(typeof e=="string")e=new URL(e);else if(!jf(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return aT(e)}function aT(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let s=-1;for(;++s<n.length;)if(n.codePointAt(s)===37&&n.codePointAt(s+1)===50){const r=n.codePointAt(s+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const pp=["history","path","basename","stem","extname","dirname"];class Ov{constructor(n){let s;n?jf(n)?s={path:n}:typeof n=="string"||oT(n)?s={value:n}:s=n:s={},this.cwd="cwd"in s?"":sT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<pp.length;){const o=pp[r];o in s&&s[o]!==void 0&&s[o]!==null&&(this[o]=o==="history"?[...s[o]]:s[o])}let i;for(i in s)pp.includes(i)||(this[i]=s[i])}get basename(){return typeof this.path=="string"?fs.basename(this.path):void 0}set basename(n){mp(n,"basename"),fp(n,"basename"),this.path=fs.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?fs.dirname(this.path):void 0}set dirname(n){Gy(this.basename,"dirname"),this.path=fs.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?fs.extname(this.path):void 0}set extname(n){if(fp(n,"extname"),Gy(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fs.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){jf(n)&&(n=iT(n)),mp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?fs.basename(this.path,this.extname):void 0}set stem(n){mp(n,"stem"),fp(n,"stem"),this.path=fs.join(this.dirname||"",n+(this.extname||""))}fail(n,s,r){const i=this.message(n,s,r);throw i.fatal=!0,i}info(n,s,r){const i=this.message(n,s,r);return i.fatal=void 0,i}message(n,s,r){const i=new Qt(n,s,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function fp(e,n){if(e&&e.includes(fs.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+fs.sep+"`")}function mp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Gy(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function oT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lT=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),cT={}.hasOwnProperty;class Rm extends lT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=G$()}copy(){const n=new Rm;let s=-1;for(;++s<this.attachers.length;){const r=this.attachers[s];n.use(...r)}return n.data(hp(!0,{},this.namespace)),n}data(n,s){return typeof n=="string"?arguments.length===2?(yp("data",this.frozen),this.namespace[n]=s,this):cT.call(this.namespace,n)&&this.namespace[n]||void 0:n?(yp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=s.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const s=Sc(n),r=this.parser||this.Parser;return gp("parse",r),r(String(s),s)}process(n,s){const r=this;return this.freeze(),gp("process",this.parser||this.Parser),xp("process",this.compiler||this.Compiler),s?i(void 0,s):new Promise(i);function i(o,l){const u=Sc(n),d=r.parse(u);r.run(d,u,function(f,m,x){if(f||!m||!x)return p(f);const y=m,j=r.stringify(y,x);hT(j)?x.value=j:x.result=j,p(f,x)});function p(f,m){f||!m?l(f):o?o(m):s(void 0,m)}}}processSync(n){let s=!1,r;return this.freeze(),gp("processSync",this.parser||this.Parser),xp("processSync",this.compiler||this.Compiler),this.process(n,i),Zy("processSync","process",s),r;function i(o,l){s=!0,Ky(o),r=l}}run(n,s,r){Qy(n),this.freeze();const i=this.transformers;return!r&&typeof s=="function"&&(r=s,s=void 0),r?o(void 0,r):new Promise(o);function o(l,u){const d=Sc(s);i.run(n,d,p);function p(f,m,x){const y=m||n;f?u(f):l?l(y):r(void 0,y,x)}}}runSync(n,s){let r=!1,i;return this.run(n,s,o),Zy("runSync","run",r),i;function o(l,u){Ky(l),i=u,r=!0}}stringify(n,s){this.freeze();const r=Sc(s),i=this.compiler||this.Compiler;return xp("stringify",i),Qy(n),i(n,r)}use(n,...s){const r=this.attachers,i=this.namespace;if(yp("use",this.frozen),n!=null)if(typeof n=="function")d(n,s);else if(typeof n=="object")Array.isArray(n)?u(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(p){if(typeof p=="function")d(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[f,...m]=p;d(f,m)}else l(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function l(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(p.plugins),p.settings&&(i.settings=hp(!0,i.settings,p.settings))}function u(p){let f=-1;if(p!=null)if(Array.isArray(p))for(;++f<p.length;){const m=p[f];o(m)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function d(p,f){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===p){x=m;break}if(x===-1)r.push([p,...f]);else if(f.length>0){let[y,...j]=f;const k=r[x][1];yf(k)&&yf(y)&&(y=hp(!0,k,y)),r[x]=[p,y,...j]}}}}const uT=new Rm().freeze();function gp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Qy(e){if(!yf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zy(e,n,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Sc(e){return dT(e)?e:new Ov(e)}function dT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hT(e){return typeof e=="string"||pT(e)}function pT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xy=[],Jy={allowDangerousHtml:!0},mT=/^(https?|ircs?|mailto|xmpp)$/i,gT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Im(e){const n=xT(e),s=yT(e);return jT(n.runSync(n.parse(s),s),e)}function xT(e){const n=e.rehypePlugins||Xy,s=e.remarkPlugins||Xy,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jy}:Jy;return uT().use(ZC).use(s).use(V$,r).use(n)}function yT(e){const n=e.children||"",s=new Ov;return typeof n=="string"&&(s.value=n),s}function jT(e,n){const s=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,u=n.unwrapDisallowed,d=n.urlTransform||kT;for(const f of gT)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+fT+f.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),Pm(e,p),F9(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0});function p(f,m,x){if(f.type==="raw"&&x&&typeof m=="number")return l?x.children.splice(m,1):x.children[m]={type:"text",value:f.value},m;if(f.type==="element"){let y;for(y in lp)if(Object.hasOwn(lp,y)&&Object.hasOwn(f.properties,y)){const j=f.properties[y],k=lp[y];(k===null||k.includes(f.tagName))&&(f.properties[y]=d(String(j||""),y,f))}}if(f.type==="element"){let y=s?!s.includes(f.tagName):o?o.includes(f.tagName):!1;if(!y&&r&&typeof m=="number"&&(y=!r(f,m,x)),y&&x&&typeof m=="number")return u&&f.children?x.children.splice(m,1,...f.children):x.children.splice(m,1),m}}}function kT(e){const n=e.indexOf(":"),s=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||s!==-1&&n>s||r!==-1&&n>r||mT.test(e.slice(0,n))?e:""}function e2(e,n){const s=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=s.indexOf(n);for(;i!==-1;)r++,i=s.indexOf(n,i+n.length);return r}function vT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const _v=[],bT=!0,jp=!1,kf="skip";function wT(e,n,s,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i,o,l,u;if(o=n,typeof o=="function")l=o;else if(o&&typeof o=="object"){if(!(o.enter===null||o.enter===void 0))if(typeof o.enter=="function")l=o.enter;else throw new Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor");if(typeof o.exit=="function")u=o.exit;else throw new Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");sl(i);const d=1;p(e,void 0,[])();function p(f,m,x){const y=f&&typeof f=="object"?f:{};if(typeof y.type=="string"){const k=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(f.type+(k?"<"+k+">":""))+")"})}return j;function j(){const k=!i;let b=_v;if(l&&k&&(b=t2(l(f,x,m)),b[0]===jp))return b;if("children"in f&&f.children){const S=f;if(S.children&&b[0]!==kf){let N=-1+d;const $=[...x,S];for(;N>-1&&N<S.children.length;){const A=S.children[N],R=p(A,N,$)();if(R[0]===jp)return R;N=typeof R[1]=="number"?R[1]:N+d}}}if(u&&k){const S=t2(u(f,x,m));if(S[0]===kf)throw new Error("Unexpected value `"+S[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(S[0]===jp||typeof S[1]=="number")return S}return b}}}function t2(e){return Array.isArray(e)?e:typeof e=="number"?[bT,e]:e==null?_v:[e]}function NT(e,n,s){const i=sl((s||{}).ignore||[]),o=ST(n);let l=-1;for(;++l<o.length;)wT(e,u);function u(p,f,m){if(p.type==="text"&&typeof m=="number")return d(p,f,m);if(i(p,m,f[f.length-1]))return kf}function d(p,f,m){const x=f[f.length-1],y=o[l][0],j=o[l][1];let k=0,b=!1,S=[];y.lastIndex=0;let N=y.exec(p.value);for(;N;){const A=N.index,R={index:N.index,input:N.input,stack:[...f,p]};let E=j(...N,R);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1)y.lastIndex=A+1;else{if(k!==A&&$({type:"text",value:p.value.slice(k,A)}),Array.isArray(E))for(const M of E)$(M);else E&&$(E);k=A+N[0].length,b=!0}if(!y.global)break;N=y.exec(p.value)}return b?(k<p.value.length&&$({type:"text",value:p.value.slice(k)}),x.children.splice(m,1,...S)):S=[p],m+S.length;function $(A){const R=S[S.length-1];R&&R.type==="text"&&A.type==="text"?R.value+=A.value:S.push(A)}}}function ST(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=[],s=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<s.length;){const i=s[r];n.push([CT(i[0]),$T(i[1])])}return n}function CT(e){return typeof e=="string"?new RegExp(vT(e),"g"):e}function $T(e){return typeof e=="function"?e:function(){return e}}const kp="phrasing",vp=["autolink","link","image","label"];function TT(){return{transforms:[zT],enter:{literalAutolink:AT,literalAutolinkEmail:bp,literalAutolinkHttp:bp,literalAutolinkWww:bp},exit:{literalAutolink:FT,literalAutolinkEmail:IT,literalAutolinkHttp:PT,literalAutolinkWww:RT}}}function ET(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kp,notInConstruct:vp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kp,notInConstruct:vp},{character:":",before:"[ps]",after:"\\/",inConstruct:kp,notInConstruct:vp}]}}function AT(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function bp(e){this.config.enter.autolinkProtocol.call(this,e)}function PT(e){this.config.exit.autolinkProtocol.call(this,e)}function RT(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function IT(e){this.config.exit.autolinkEmail.call(this,e)}function FT(e){this.exit(e)}function zT(e){NT(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LT],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,MT]],{ignore:["link","linkReference"]})}function LT(e,n,s,r,i){let o="";if(!Dv(i)||(/^w/i.test(n)&&(s=n+s,n="",o="http://"),!qT(s)))return!1;const l=OT(s+r);if(!l[0])return!1;const u={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function MT(e,n,s,r){return!Dv(r,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+s,children:[{type:"text",value:n+"@"+s}]}}function qT(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function OT(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let s=n[0],r=s.indexOf(")");const i=e2(e,"(");let o=e2(e,")");for(;r!==-1&&i>o;)e+=s.slice(0,r+1),s=s.slice(r+1),r=s.indexOf(")"),o++;return[e,s]}function Dv(e,n){const s=e.input.charCodeAt(e.index-1);return(e.index===0||Yr(s)||Lu(s))&&(!n||s!==47)}Bv.peek=YT;function _T(){this.buffer()}function DT(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function BT(){this.buffer()}function WT(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UT(e){const n=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=rs(this.sliceSerialize(e)).toLowerCase(),s.label=n}function HT(e){this.exit(e)}function VT(e){const n=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=rs(this.sliceSerialize(e)).toLowerCase(),s.label=n}function KT(e){this.exit(e)}function YT(){return"["}function Bv(e,n,s,r){const i=s.createTracker(r);let o=i.move("[^");const l=s.enter("footnoteReference"),u=s.enter("reference");return o+=i.move(s.safe(s.associationId(e),{after:"]",before:o})),u(),l(),o+=i.move("]"),o}function GT(){return{enter:{gfmFootnoteCallString:_T,gfmFootnoteCall:DT,gfmFootnoteDefinitionLabelString:BT,gfmFootnoteDefinition:WT},exit:{gfmFootnoteCallString:UT,gfmFootnoteCall:HT,gfmFootnoteDefinitionLabelString:VT,gfmFootnoteDefinition:KT}}}function QT(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:s,footnoteReference:Bv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(r,i,o,l){const u=o.createTracker(l);let d=u.move("[^");const p=o.enter("footnoteDefinition"),f=o.enter("label");return d+=u.move(o.safe(o.associationId(r),{before:d,after:"]"})),f(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((n?`
597
+ `:" ")+o.indentLines(o.containerFlow(r,u.current()),n?Wv:ZT))),p(),d}}function ZT(e,n,s){return n===0?e:Wv(e,n,s)}function Wv(e,n,s){return(s?"":" ")+e}const XT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Fm.attention=sE;Fm.peek=rE;function JT(){return{canContainEols:["delete"],enter:{strikethrough:tE},exit:{strikethrough:nE}}}function eE(){return{handlers:{delete:Fm},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XT}]}}function tE(e){this.enter({type:"delete",children:[],position:void 0},e)}function nE(e){this.exit(e)}function Fm(e,n,s,r){const i=s.createTracker(r),o=s.stack.includes("strikethrough")?"~":"~~",l=s.enter("strikethrough");let u=i.move(o);return u+=s.containerPhrasing(e,{...i.current(),before:u,after:"~"}),u+=i.move(o),l(),u}function sE(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function rE(){return"~"}function iE(e){return e.length}function aE(e,n){const s=n||{},r=(s.align||[]).concat(),i=s.stringLength||iE,o=[],l=[],u=[],d=[];let p=0,f=-1;for(;++f<e.length;){const k=[],b=[];let S=-1;for(e[f].length>p&&(p=e[f].length);++S<e[f].length;){const N=oE(e[f][S]);if(s.alignDelimiters!==!1){const $=i(N);b[S]=$,(d[S]===void 0||$>d[S])&&(d[S]=$)}k.push(N)}l[f]=k,u[f]=b}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<p;)o[m]=n2(r[m]);else{const k=n2(r);for(;++m<p;)o[m]=k}m=-1;const x=[],y=[];for(;++m<p;){const k=o[m];let b="",S="";k===99?(b=":",S=":"):k===108?b=":":k===114&&(S=":");let N=s.alignDelimiters===!1?1:Math.max(1,d[m]-b.length-S.length);const $=b+"-".repeat(N)+S;s.alignDelimiters!==!1&&(N=b.length+N+S.length,N>d[m]&&(d[m]=N),y[m]=N),x[m]=$}l.splice(1,0,x),u.splice(1,0,y),f=-1;const j=[];for(;++f<l.length;){const k=l[f],b=u[f];m=-1;const S=[];for(;++m<p;){const N=k[m]||"";let $="",A="";if(s.alignDelimiters!==!1){const R=d[m]-(b[m]||0),E=o[m];E===114?$=" ".repeat(R):E===99?R%2?($=" ".repeat(R/2+.5),A=" ".repeat(R/2-.5)):($=" ".repeat(R/2),A=$):A=" ".repeat(R)}s.delimiterStart!==!1&&!m&&S.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&N==="")&&(s.delimiterStart!==!1||m)&&S.push(" "),s.alignDelimiters!==!1&&S.push($),S.push(N),s.alignDelimiters!==!1&&S.push(A),s.padding!==!1&&S.push(" "),(s.delimiterEnd!==!1||m!==p-1)&&S.push("|")}j.push(s.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return j.join(`
598
+ `)}function oE(e){return e==null?"":String(e)}function n2(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function lE(e,n,s,r){const i=s.enter("blockquote"),o=s.createTracker(r);o.move("> "),o.shift(2);const l=s.indentLines(s.containerFlow(e,o.current()),cE);return i(),l}function cE(e,n,s){return">"+(s?"":" ")+e}function uE(e,n){return s2(e,n.inConstruct,!0)&&!s2(e,n.notInConstruct,!1)}function s2(e,n,s){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return s;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function r2(e,n,s,r){let i=-1;for(;++i<s.unsafe.length;)if(s.unsafe[i].character===`
599
+ `&&uE(s.stack,s.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
600
+ `}function dE(e,n){const s=String(e);let r=s.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=s.indexOf(n,i);return l}function hE(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function pE(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function fE(e,n,s,r){const i=pE(s),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(hE(e,s)){const m=s.enter("codeIndented"),x=s.indentLines(o,mE);return m(),x}const u=s.createTracker(r),d=i.repeat(Math.max(dE(o,i)+1,3)),p=s.enter("codeFenced");let f=u.move(d);if(e.lang){const m=s.enter(`codeFencedLang${l}`);f+=u.move(s.safe(e.lang,{before:f,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=s.enter(`codeFencedMeta${l}`);f+=u.move(" "),f+=u.move(s.safe(e.meta,{before:f,after:`
601
+ `,encode:["`"],...u.current()})),m()}return f+=u.move(`
602
+ `),o&&(f+=u.move(o+`
603
+ `)),f+=u.move(d),p(),f}function mE(e,n,s){return(s?"":" ")+e}function zm(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function gE(e,n,s,r){const i=zm(s),o=i==='"'?"Quote":"Apostrophe",l=s.enter("definition");let u=s.enter("label");const d=s.createTracker(r);let p=d.move("[");return p+=d.move(s.safe(s.associationId(e),{before:p,after:"]",...d.current()})),p+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=s.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(s.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(u=s.enter("destinationRaw"),p+=d.move(s.safe(e.url,{before:p,after:e.title?" ":`
604
+ `,...d.current()}))),u(),e.title&&(u=s.enter(`title${o}`),p+=d.move(" "+i),p+=d.move(s.safe(e.title,{before:p,after:i,...d.current()})),p+=d.move(i),u()),l(),p}function xE(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function To(e){return"&#x"+e.toString(16).toUpperCase()+";"}function hu(e,n,s){const r=Yi(e),i=Yi(n);return r===void 0?i===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Uv.peek=yE;function Uv(e,n,s,r){const i=xE(s),o=s.enter("emphasis"),l=s.createTracker(r),u=l.move(i);let d=l.move(s.containerPhrasing(e,{after:i,before:u,...l.current()}));const p=d.charCodeAt(0),f=hu(r.before.charCodeAt(r.before.length-1),p,i);f.inside&&(d=To(p)+d.slice(1));const m=d.charCodeAt(d.length-1),x=hu(r.after.charCodeAt(0),m,i);x.inside&&(d=d.slice(0,-1)+To(m));const y=l.move(i);return o(),s.attentionEncodeSurroundingInfo={after:x.outside,before:f.outside},u+d+y}function yE(e,n,s){return s.options.emphasis||"*"}function jE(e,n){let s=!1;return Pm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return s=!0,gf}),!!((!e.depth||e.depth<3)&&Nm(e)&&(n.options.setext||s))}function kE(e,n,s,r){const i=Math.max(Math.min(6,e.depth||1),1),o=s.createTracker(r);if(jE(e,s)){const f=s.enter("headingSetext"),m=s.enter("phrasing"),x=s.containerPhrasing(e,{...o.current(),before:`
605
+ `,after:`
606
+ `});return m(),f(),x+`
607
+ `+(i===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
608
+ `))+1))}const l="#".repeat(i),u=s.enter("headingAtx"),d=s.enter("phrasing");o.move(l+" ");let p=s.containerPhrasing(e,{before:"# ",after:`
609
+ `,...o.current()});return/^[\t ]/.test(p)&&(p=To(p.charCodeAt(0))+p.slice(1)),p=p?l+" "+p:l,s.options.closeAtx&&(p+=" "+l),d(),u(),p}Hv.peek=vE;function Hv(e){return e.value||""}function vE(){return"<"}Vv.peek=bE;function Vv(e,n,s,r){const i=zm(s),o=i==='"'?"Quote":"Apostrophe",l=s.enter("image");let u=s.enter("label");const d=s.createTracker(r);let p=d.move("![");return p+=d.move(s.safe(e.alt,{before:p,after:"]",...d.current()})),p+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=s.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(s.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(u=s.enter("destinationRaw"),p+=d.move(s.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=s.enter(`title${o}`),p+=d.move(" "+i),p+=d.move(s.safe(e.title,{before:p,after:i,...d.current()})),p+=d.move(i),u()),p+=d.move(")"),l(),p}function bE(){return"!"}Kv.peek=wE;function Kv(e,n,s,r){const i=e.referenceType,o=s.enter("imageReference");let l=s.enter("label");const u=s.createTracker(r);let d=u.move("![");const p=s.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(p+"]["),l();const f=s.stack;s.stack=[],l=s.enter("reference");const m=s.safe(s.associationId(e),{before:d,after:"]",...u.current()});return l(),s.stack=f,o(),i==="full"||!p||p!==m?d+=u.move(m+"]"):i==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function wE(){return"!"}Yv.peek=NE;function Yv(e,n,s){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<s.unsafe.length;){const l=s.unsafe[o],u=s.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let p=d.index;r.charCodeAt(p)===10&&r.charCodeAt(p-1)===13&&p--,r=r.slice(0,p)+" "+r.slice(d.index+1)}}return i+r+i}function NE(){return"`"}function Gv(e,n){const s=Nm(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(s===e.url||"mailto:"+s===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Qv.peek=SE;function Qv(e,n,s,r){const i=zm(s),o=i==='"'?"Quote":"Apostrophe",l=s.createTracker(r);let u,d;if(Gv(e,s)){const f=s.stack;s.stack=[],u=s.enter("autolink");let m=l.move("<");return m+=l.move(s.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),s.stack=f,m}u=s.enter("link"),d=s.enter("label");let p=l.move("[");return p+=l.move(s.containerPhrasing(e,{before:p,after:"](",...l.current()})),p+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=s.enter("destinationLiteral"),p+=l.move("<"),p+=l.move(s.safe(e.url,{before:p,after:">",...l.current()})),p+=l.move(">")):(d=s.enter("destinationRaw"),p+=l.move(s.safe(e.url,{before:p,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=s.enter(`title${o}`),p+=l.move(" "+i),p+=l.move(s.safe(e.title,{before:p,after:i,...l.current()})),p+=l.move(i),d()),p+=l.move(")"),u(),p}function SE(e,n,s){return Gv(e,s)?"<":"["}Zv.peek=CE;function Zv(e,n,s,r){const i=e.referenceType,o=s.enter("linkReference");let l=s.enter("label");const u=s.createTracker(r);let d=u.move("[");const p=s.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(p+"]["),l();const f=s.stack;s.stack=[],l=s.enter("reference");const m=s.safe(s.associationId(e),{before:d,after:"]",...u.current()});return l(),s.stack=f,o(),i==="full"||!p||p!==m?d+=u.move(m+"]"):i==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function CE(){return"["}function Lm(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function $E(e){const n=Lm(e),s=e.options.bulletOther;if(!s)return n==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+s+"`) to be different");return s}function TE(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Xv(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function EE(e,n,s,r){const i=s.enter("list"),o=s.bulletCurrent;let l=e.ordered?TE(s):Lm(s);const u=e.ordered?l==="."?")":".":$E(s);let d=n&&s.bulletLastUsed?l===s.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(d=!0),Xv(s)===l&&f){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),s.bulletCurrent=l;const p=s.containerFlow(e,r);return s.bulletLastUsed=l,s.bulletCurrent=o,i(),p}function AE(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function PE(e,n,s,r){const i=AE(s);let o=s.bulletCurrent||Lm(s);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(s.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=s.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);const d=s.enter("listItem"),p=s.indentLines(s.containerFlow(e,u.current()),f);return d(),p;function f(m,x,y){return x?(y?"":" ".repeat(l))+m:(y?o:o+" ".repeat(l-o.length))+m}}function RE(e,n,s,r){const i=s.enter("paragraph"),o=s.enter("phrasing"),l=s.containerPhrasing(e,r);return o(),i(),l}const IE=sl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function FE(e,n,s,r){return(e.children.some(function(l){return IE(l)})?s.containerPhrasing:s.containerFlow).call(s,e,r)}function zE(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Jv.peek=LE;function Jv(e,n,s,r){const i=zE(s),o=s.enter("strong"),l=s.createTracker(r),u=l.move(i+i);let d=l.move(s.containerPhrasing(e,{after:i,before:u,...l.current()}));const p=d.charCodeAt(0),f=hu(r.before.charCodeAt(r.before.length-1),p,i);f.inside&&(d=To(p)+d.slice(1));const m=d.charCodeAt(d.length-1),x=hu(r.after.charCodeAt(0),m,i);x.inside&&(d=d.slice(0,-1)+To(m));const y=l.move(i+i);return o(),s.attentionEncodeSurroundingInfo={after:x.outside,before:f.outside},u+d+y}function LE(e,n,s){return s.options.strong||"*"}function ME(e,n,s,r){return s.safe(e.value,r)}function qE(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function OE(e,n,s){const r=(Xv(s)+(s.options.ruleSpaces?" ":"")).repeat(qE(s));return s.options.ruleSpaces?r.slice(0,-1):r}const eb={blockquote:lE,break:r2,code:fE,definition:gE,emphasis:Uv,hardBreak:r2,heading:kE,html:Hv,image:Vv,imageReference:Kv,inlineCode:Yv,link:Qv,linkReference:Zv,list:EE,listItem:PE,paragraph:RE,root:FE,strong:Jv,text:ME,thematicBreak:OE};function _E(){return{enter:{table:DE,tableData:i2,tableHeader:i2,tableRow:WE},exit:{codeText:UE,table:BE,tableData:wp,tableHeader:wp,tableRow:wp}}}function DE(e){const n=e._align;this.enter({type:"table",align:n.map(function(s){return s==="none"?null:s}),children:[]},e),this.data.inTable=!0}function BE(e){this.exit(e),this.data.inTable=void 0}function WE(e){this.enter({type:"tableRow",children:[]},e)}function wp(e){this.exit(e)}function i2(e){this.enter({type:"tableCell",children:[]},e)}function UE(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,HE));const s=this.stack[this.stack.length-1];s.type,s.value=n,this.exit(e)}function HE(e,n){return n==="|"?n:e}function VE(e){const n=e||{},s=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
610
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:d,tableRow:u}};function l(y,j,k,b){return p(f(y,k,b),y.align)}function u(y,j,k,b){const S=m(y,k,b),N=p([S]);return N.slice(0,N.indexOf(`
611
+ `))}function d(y,j,k,b){const S=k.enter("tableCell"),N=k.enter("phrasing"),$=k.containerPhrasing(y,{...b,before:o,after:o});return N(),S(),$}function p(y,j){return aE(y,{align:j,alignDelimiters:r,padding:s,stringLength:i})}function f(y,j,k){const b=y.children;let S=-1;const N=[],$=j.enter("table");for(;++S<b.length;)N[S]=m(b[S],j,k);return $(),N}function m(y,j,k){const b=y.children;let S=-1;const N=[],$=j.enter("tableRow");for(;++S<b.length;)N[S]=d(b[S],y,j,k);return $(),N}function x(y,j,k){let b=eb.inlineCode(y,j,k);return k.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function KE(){return{exit:{taskListCheckValueChecked:a2,taskListCheckValueUnchecked:a2,paragraph:GE}}}function YE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:QE}}}function a2(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function GE(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const r=s.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){l=u;break}}l===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function QE(e,n,s,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=s.createTracker(r);o&&u.move(l);let d=eb.listItem(e,n,s,{...r,...u.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),d;function p(f){return f+l}}function ZE(){return[TT(),GT(),JT(),_E(),KE()]}function XE(e){return{extensions:[ET(),QT(e),eE(),VE(e),YE()]}}const JE={tokenize:iA,partial:!0},tb={tokenize:aA,partial:!0},nb={tokenize:oA,partial:!0},sb={tokenize:lA,partial:!0},eA={tokenize:cA,partial:!0},rb={name:"wwwAutolink",tokenize:sA,previous:ab},ib={name:"protocolAutolink",tokenize:rA,previous:ob},Us={name:"emailAutolink",tokenize:nA,previous:lb},Ns={};function tA(){return{text:Ns}}let Lr=48;for(;Lr<123;)Ns[Lr]=Us,Lr++,Lr===58?Lr=65:Lr===91&&(Lr=97);Ns[43]=Us;Ns[45]=Us;Ns[46]=Us;Ns[95]=Us;Ns[72]=[Us,ib];Ns[104]=[Us,ib];Ns[87]=[Us,rb];Ns[119]=[Us,rb];function nA(e,n,s){const r=this;let i,o;return l;function l(m){return!vf(m)||!lb.call(r,r.previous)||Mm(r.events)?s(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return vf(m)?(e.consume(m),u):m===64?(e.consume(m),d):s(m)}function d(m){return m===46?e.check(eA,f,p)(m):m===45||m===95||Ht(m)?(o=!0,e.consume(m),d):f(m)}function p(m){return e.consume(m),i=!0,d}function f(m){return o&&i&&en(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):s(m)}}function sA(e,n,s){const r=this;return i;function i(l){return l!==87&&l!==119||!ab.call(r,r.previous)||Mm(r.events)?s(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(JE,e.attempt(tb,e.attempt(nb,o),s),s)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function rA(e,n,s){const r=this;let i="",o=!1;return l;function l(m){return(m===72||m===104)&&ob.call(r,r.previous)&&!Mm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),e.consume(m),u):s(m)}function u(m){if(en(m)&&i.length<5)return i+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const x=i.toLowerCase();if(x==="http"||x==="https")return e.consume(m),d}return s(m)}function d(m){return m===47?(e.consume(m),o?p:(o=!0,d)):s(m)}function p(m){return m===null||cu(m)||et(m)||Yr(m)||Lu(m)?s(m):e.attempt(tb,e.attempt(nb,f),s)(m)}function f(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function iA(e,n,s){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):s(l)}function o(l){return l===null?s(l):n(l)}}function aA(e,n,s){let r,i,o;return l;function l(p){return p===46||p===95?e.check(sb,d,u)(p):p===null||et(p)||Yr(p)||p!==45&&Lu(p)?d(p):(o=!0,e.consume(p),l)}function u(p){return p===95?r=!0:(i=r,r=void 0),e.consume(p),l}function d(p){return i||r||!o?s(p):n(p)}}function oA(e,n){let s=0,r=0;return i;function i(l){return l===40?(s++,e.consume(l),i):l===41&&r<s?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(sb,n,o)(l):l===null||et(l)||Yr(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function lA(e,n,s){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),i):u===60||u===null||et(u)||Yr(u)?n(u):s(u)}function i(u){return u===null||u===40||u===91||et(u)||Yr(u)?n(u):r(u)}function o(u){return en(u)?l(u):s(u)}function l(u){return u===59?(e.consume(u),r):en(u)?(e.consume(u),l):s(u)}}function cA(e,n,s){return r;function r(o){return e.consume(o),i}function i(o){return Ht(o)?s(o):n(o)}}function ab(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||et(e)}function ob(e){return!en(e)}function lb(e){return!(e===47||vf(e))}function vf(e){return e===43||e===45||e===46||e===95||Ht(e)}function Mm(e){let n=e.length,s=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return e.length>0&&!s&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const uA={tokenize:yA,partial:!0};function dA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:mA,continuation:{tokenize:gA},exit:xA}},text:{91:{name:"gfmFootnoteCall",tokenize:fA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hA,resolveTo:pA}}}}function hA(e,n,s){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const d=r.events[i][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return s(d);const p=rs(r.sliceSerialize({start:l.end,end:r.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?s(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),n(d))}}function pA(e,n){let s=e.length;for(;s--;)if(e[s][1].type==="labelImage"&&e[s][0]==="enter"){e[s][1];break}e[s+1][1].type="data",e[s+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[s+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[s+3][1].end),end:Object.assign({},e[s+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[s+1],e[s+2],["enter",r,n],e[s+3],e[s+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(s,e.length-s+1,...u),e}function fA(e,n,s){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?s(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(m){if(o>999||m===93&&!l||m===null||m===91||et(m))return s(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return i.includes(rs(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):s(m)}return et(m)||(l=!0),o++,e.consume(m),m===92?f:p}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,p):p(m)}}function mA(e,n,s){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,u;return d;function d(j){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(j){return j===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):s(j)}function f(j){if(l>999||j===93&&!u||j===null||j===91||et(j))return s(j);if(j===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=rs(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return et(j)||(u=!0),l++,e.consume(j),j===92?m:f}function m(j){return j===91||j===92||j===93?(e.consume(j),l++,f):f(j)}function x(j){return j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ue(e,y,"gfmFootnoteDefinitionWhitespace")):s(j)}function y(j){return n(j)}}function gA(e,n,s){return e.check(nl,n,e.attempt(uA,n,s))}function xA(e){e.exit("gfmFootnoteDefinition")}function yA(e,n,s){const r=this;return Ue(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):s(o)}}function jA(e){let s=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let p=d;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[d][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[d][1].start)},x=[["enter",f,u],["enter",l[p][1],u],["exit",l[p][1],u],["enter",m,u]],y=u.parser.constructs.insideSpan.null;y&&Nn(x,x.length,0,Mu(y,l.slice(p+1,d),u)),Nn(x,x.length,0,[["exit",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",f,u]]),Nn(l,p-1,d-p+3,x),d=p+x.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function o(l,u,d){const p=this.previous,f=this.events;let m=0;return x;function x(j){return p===126&&f[f.length-1][1].type!=="characterEscape"?d(j):(l.enter("strikethroughSequenceTemporary"),y(j))}function y(j){const k=Yi(p);if(j===126)return m>1?d(j):(l.consume(j),m++,y);if(m<2&&!s)return d(j);const b=l.exit("strikethroughSequenceTemporary"),S=Yi(j);return b._open=!S||S===2&&!!k,b._close=!k||k===2&&!!S,u(j)}}}class kA{constructor(){this.map=[],this.index=new Map}add(n,s,r){vA(this,n,s,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let s=this.map.length;const r=[];for(;s>0;)s-=1,r.push(n.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),n.length=this.map[s][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0,this.index.clear()}}function vA(e,n,s,r){if(s===0&&r.length===0)return;const i=e.index.get(n);if(i){i[1]+=s,i[2].push(...r);return}const o=[n,s,r];e.map.push(o),e.index.set(n,o)}function bA(e,n){let s=!1;const r=[];for(;n<e.length;){const i=e[n];if(s){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(s=!0);n+=1}return r}function wA(){return{flow:{null:{name:"table",tokenize:NA,resolveAll:SA}}}}function NA(e,n,s){const r=this;let i=0,o=0,l;return u;function u(I){let q=r.events.length-1;for(;q>-1;){const{type:_}=r.events[q][1];if(_==="lineEnding"||_==="linePrefix")q--;else break}const L=q>-1?r.events[q][1].type:null,U=L==="tableHead"||L==="tableRow"?E:d;return U===E&&r.parser.lazy[r.now().line]?s(I):U(I)}function d(I){return e.enter("tableHead"),e.enter("tableRow"),p(I)}function p(I){return I===124||(l=!0,o+=1),f(I)}function f(I){return I===null?s(I):Pe(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),y):s(I):Be(I)?Ue(e,f,"whitespace")(I):(o+=1,l&&(l=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||et(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?x:m)}function x(I){return I===92||I===124?(e.consume(I),m):m(I)}function y(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(I):(e.enter("tableDelimiterRow"),l=!1,Be(I)?Ue(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):j(I))}function j(I){return I===45||I===58?b(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):R(I)}function k(I){return Be(I)?Ue(e,b,"whitespace")(I):b(I)}function b(I){return I===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),S):I===45?(o+=1,S(I)):I===null||Pe(I)?A(I):R(I)}function S(I){return I===45?(e.enter("tableDelimiterFiller"),N(I)):R(I)}function N(I){return I===45?(e.consume(I),N):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(I))}function $(I){return Be(I)?Ue(e,A,"whitespace")(I):A(I)}function A(I){return I===124?j(I):I===null||Pe(I)?!l||i!==o?R(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(I)):R(I)}function R(I){return s(I)}function E(I){return e.enter("tableRow"),M(I)}function M(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),M):I===null||Pe(I)?(e.exit("tableRow"),n(I)):Be(I)?Ue(e,M,"whitespace")(I):(e.enter("data"),F(I))}function F(I){return I===null||I===124||et(I)?(e.exit("data"),M(I)):(e.consume(I),I===92?W:F)}function W(I){return I===92||I===124?(e.consume(I),F):F(I)}}function SA(e,n){let s=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,p,f,m;const x=new kA;for(;++s<e.length;){const y=e[s],j=y[1];y[0]==="enter"?j.type==="tableHead"?(u=!1,d!==0&&(o2(x,n,d,p,f),f=void 0,d=0),p={type:"table",start:Object.assign({},j.start),end:Object.assign({},j.end)},x.add(s,0,[["enter",p,n]])):j.type==="tableRow"||j.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],l=[0,s+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},j.start),end:Object.assign({},j.end)},x.add(s,0,[["enter",f,n]])),i=j.type==="tableDelimiterRow"?2:f?3:1):i&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],m=Cc(x,n,o,i,void 0,m),o=[0,0,0,0]),l[2]=s)):j.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],m=Cc(x,n,o,i,void 0,m)),o=l,l=[o[1],s,0,0])):j.type==="tableHead"?(u=!0,d=s):j.type==="tableRow"||j.type==="tableDelimiterRow"?(d=s,o[1]!==0?(l[0]=l[1],m=Cc(x,n,o,i,s,m)):l[1]!==0&&(m=Cc(x,n,l,i,s,m)),i=0):i&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")&&(l[3]=s)}for(d!==0&&o2(x,n,d,p,f),x.consume(n.events),s=-1;++s<n.events.length;){const y=n.events[s];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=bA(n.events,s))}return e}function Cc(e,n,s,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";s[0]!==0&&(o.end=Object.assign({},Oi(n.events,s[0])),e.add(s[0],0,[["exit",o,n]]));const d=Oi(n.events,s[1]);if(o={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(s[1],0,[["enter",o,n]]),s[2]!==0){const p=Oi(n.events,s[2]),f=Oi(n.events,s[3]),m={type:u,start:Object.assign({},p),end:Object.assign({},f)};if(e.add(s[2],0,[["enter",m,n]]),r!==2){const x=n.events[s[2]],y=n.events[s[3]];if(x[1].end=Object.assign({},y[1].end),x[1].type="chunkText",x[1].contentType="text",s[3]>s[2]+1){const j=s[2]+1,k=s[3]-s[2]-1;e.add(j,k,[])}}e.add(s[3]+1,0,[["exit",m,n]])}return i!==void 0&&(o.end=Object.assign({},Oi(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function o2(e,n,s,r,i){const o=[],l=Oi(n.events,s);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(s+1,0,o)}function Oi(e,n){const s=e[n],r=s[0]==="enter"?"start":"end";return s[1][r]}const CA={name:"tasklistCheck",tokenize:TA};function $A(){return{text:{91:CA}}}function TA(e,n,s){const r=this;return i;function i(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),o)}function o(d){return et(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):s(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):s(d)}function u(d){return Pe(d)?n(d):Be(d)?e.check({tokenize:EA},n,s)(d):s(d)}}function EA(e,n,s){return Ue(e,r,"whitespace");function r(i){return i===null?s(i):n(i)}}function AA(e){return kv([tA(),dA(),jA(e),wA(),$A()])}const PA={};function qm(e){const n=this,s=e||PA,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(AA(s)),o.push(ZE()),l.push(XE(s))}function cb(e){var n,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(s=cb(e[n]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function ub(){for(var e,n,s=0,r="",i=arguments.length;s<i;s++)(e=arguments[s])&&(n=cb(e))&&(r&&(r+=" "),r+=n);return r}var RA=Object.create,_u=Object.defineProperty,IA=Object.defineProperties,FA=Object.getOwnPropertyDescriptor,zA=Object.getOwnPropertyDescriptors,db=Object.getOwnPropertyNames,pu=Object.getOwnPropertySymbols,LA=Object.getPrototypeOf,Om=Object.prototype.hasOwnProperty,hb=Object.prototype.propertyIsEnumerable,l2=(e,n,s)=>n in e?_u(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,ys=(e,n)=>{for(var s in n||(n={}))Om.call(n,s)&&l2(e,s,n[s]);if(pu)for(var s of pu(n))hb.call(n,s)&&l2(e,s,n[s]);return e},Du=(e,n)=>IA(e,zA(n)),pb=(e,n)=>{var s={};for(var r in e)Om.call(e,r)&&n.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&pu)for(var r of pu(e))n.indexOf(r)<0&&hb.call(e,r)&&(s[r]=e[r]);return s},MA=(e,n)=>function(){return n||(0,e[db(e)[0]])((n={exports:{}}).exports,n),n.exports},qA=(e,n)=>{for(var s in n)_u(e,s,{get:n[s],enumerable:!0})},OA=(e,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of db(n))!Om.call(e,i)&&i!==s&&_u(e,i,{get:()=>n[i],enumerable:!(r=FA(n,i))||r.enumerable});return e},_A=(e,n,s)=>(s=e!=null?RA(LA(e)):{},OA(!e||!e.__esModule?_u(s,"default",{value:e,enumerable:!0}):s,e)),DA=MA({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,n){var s=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},l={util:{encode:function j(k){return k instanceof u?new u(k.type,j(k.content),k.alias):Array.isArray(k)?k.map(j):k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(j){return Object.prototype.toString.call(j).slice(8,-1)},objId:function(j){return j.__id||Object.defineProperty(j,"__id",{value:++i}),j.__id},clone:function j(k,b){b=b||{};var S,N;switch(l.util.type(k)){case"Object":if(N=l.util.objId(k),b[N])return b[N];S={},b[N]=S;for(var $ in k)k.hasOwnProperty($)&&(S[$]=j(k[$],b));return S;case"Array":return N=l.util.objId(k),b[N]?b[N]:(S=[],b[N]=S,k.forEach(function(A,R){S[R]=j(A,b)}),S);default:return k}},getLanguage:function(j){for(;j;){var k=r.exec(j.className);if(k)return k[1].toLowerCase();j=j.parentElement}return"none"},setLanguage:function(j,k){j.className=j.className.replace(RegExp(r,"gi"),""),j.classList.add("language-"+k)},isActive:function(j,k,b){for(var S="no-"+k;j;){var N=j.classList;if(N.contains(k))return!0;if(N.contains(S))return!1;j=j.parentElement}return!!b}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(j,k){var b=l.util.clone(l.languages[j]);for(var S in k)b[S]=k[S];return b},insertBefore:function(j,k,b,S){S=S||l.languages;var N=S[j],$={};for(var A in N)if(N.hasOwnProperty(A)){if(A==k)for(var R in b)b.hasOwnProperty(R)&&($[R]=b[R]);b.hasOwnProperty(A)||($[A]=N[A])}var E=S[j];return S[j]=$,l.languages.DFS(l.languages,function(M,F){F===E&&M!=j&&(this[M]=$)}),$},DFS:function j(k,b,S,N){N=N||{};var $=l.util.objId;for(var A in k)if(k.hasOwnProperty(A)){b.call(k,A,k[A],S||A);var R=k[A],E=l.util.type(R);E==="Object"&&!N[$(R)]?(N[$(R)]=!0,j(R,b,null,N)):E==="Array"&&!N[$(R)]&&(N[$(R)]=!0,j(R,b,A,N))}}},plugins:{},highlight:function(j,k,b){var S={code:j,grammar:k,language:b};if(l.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=l.tokenize(S.code,S.grammar),l.hooks.run("after-tokenize",S),u.stringify(l.util.encode(S.tokens),S.language)},tokenize:function(j,k){var b=k.rest;if(b){for(var S in b)k[S]=b[S];delete k.rest}var N=new f;return m(N,N.head,j),p(j,N,k,N.head,0),y(N)},hooks:{all:{},add:function(j,k){var b=l.hooks.all;b[j]=b[j]||[],b[j].push(k)},run:function(j,k){var b=l.hooks.all[j];if(!(!b||!b.length))for(var S=0,N;N=b[S++];)N(k)}},Token:u};function u(j,k,b,S){this.type=j,this.content=k,this.alias=b,this.length=(S||"").length|0}u.stringify=function j(k,b){if(typeof k=="string")return k;if(Array.isArray(k)){var S="";return k.forEach(function(E){S+=j(E,b)}),S}var N={type:k.type,content:j(k.content,b),tag:"span",classes:["token",k.type],attributes:{},language:b},$=k.alias;$&&(Array.isArray($)?Array.prototype.push.apply(N.classes,$):N.classes.push($)),l.hooks.run("wrap",N);var A="";for(var R in N.attributes)A+=" "+R+'="'+(N.attributes[R]||"").replace(/"/g,"&quot;")+'"';return"<"+N.tag+' class="'+N.classes.join(" ")+'"'+A+">"+N.content+"</"+N.tag+">"};function d(j,k,b,S){j.lastIndex=k;var N=j.exec(b);if(N&&S&&N[1]){var $=N[1].length;N.index+=$,N[0]=N[0].slice($)}return N}function p(j,k,b,S,N,$){for(var A in b)if(!(!b.hasOwnProperty(A)||!b[A])){var R=b[A];R=Array.isArray(R)?R:[R];for(var E=0;E<R.length;++E){if($&&$.cause==A+","+E)return;var M=R[E],F=M.inside,W=!!M.lookbehind,I=!!M.greedy,q=M.alias;if(I&&!M.pattern.global){var L=M.pattern.toString().match(/[imsuy]*$/)[0];M.pattern=RegExp(M.pattern.source,L+"g")}for(var U=M.pattern||M,_=S.next,G=N;_!==k.tail&&!($&&G>=$.reach);G+=_.value.length,_=_.next){var le=_.value;if(k.length>j.length)return;if(!(le instanceof u)){var V=1,Y;if(I){if(Y=d(U,G,j,W),!Y||Y.index>=j.length)break;var J=Y.index,te=Y.index+Y[0].length,P=G;for(P+=_.value.length;J>=P;)_=_.next,P+=_.value.length;if(P-=_.value.length,G=P,_.value instanceof u)continue;for(var B=_;B!==k.tail&&(P<te||typeof B.value=="string");B=B.next)V++,P+=B.value.length;V--,le=j.slice(G,P),Y.index-=G}else if(Y=d(U,0,le,W),!Y)continue;var J=Y.index,z=Y[0],ye=le.slice(0,J),fe=le.slice(J+z.length),ve=G+le.length;$&&ve>$.reach&&($.reach=ve);var Fe=_.prev;ye&&(Fe=m(k,Fe,ye),G+=ye.length),x(k,Fe,V);var Ie=new u(A,F?l.tokenize(z,F):z,q,z);if(_=m(k,Fe,Ie),fe&&m(k,_,fe),V>1){var Re={cause:A+","+E,reach:ve};p(j,k,b,_.prev,G,Re),$&&Re.reach>$.reach&&($.reach=Re.reach)}}}}}}function f(){var j={value:null,prev:null,next:null},k={value:null,prev:j,next:null};j.next=k,this.head=j,this.tail=k,this.length=0}function m(j,k,b){var S=k.next,N={value:b,prev:k,next:S};return k.next=N,S.prev=N,j.length++,N}function x(j,k,b){for(var S=k.next,N=0;N<b&&S!==j.tail;N++)S=S.next;k.next=S,S.prev=k,j.length-=N}function y(j){for(var k=[],b=j.head.next;b!==j.tail;)k.push(b.value),b=b.next;return k}return l})();n.exports=s,s.default=s}}),ne=_A(DA());ne.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ne.languages.markup.tag.inside["attr-value"].inside.entity=ne.languages.markup.entity,ne.languages.markup.doctype.inside["internal-subset"].inside=ne.languages.markup,ne.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(ne.languages.markup.tag,"addInlined",{value:function(e,r){var s={},s=(s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ne.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}}),r=(s["language-"+r]={pattern:/[\s\S]+/,inside:ne.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:s},ne.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ne.languages.markup.tag,"addAttribute",{value:function(e,n){ne.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:ne.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ne.languages.html=ne.languages.markup,ne.languages.mathml=ne.languages.markup,ne.languages.svg=ne.languages.markup,ne.languages.xml=ne.languages.extend("markup",{}),ne.languages.ssml=ne.languages.xml,ne.languages.atom=ne.languages.xml,ne.languages.rss=ne.languages.xml,(function(e){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},s=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+s.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:s,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:s}},"special-escape":n,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:s,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ne),ne.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ne.languages.javascript=ne.languages.extend("clike",{"class-name":[ne.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ne.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ne.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ne.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ne.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ne.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ne.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ne.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ne.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ne.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ne.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ne.languages.markup&&(ne.languages.markup.tag.addInlined("script","javascript"),ne.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ne.languages.js=ne.languages.javascript,ne.languages.actionscript=ne.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ne.languages.actionscript["class-name"].alias="function",delete ne.languages.actionscript.parameter,delete ne.languages.actionscript["literal-property"],ne.languages.markup&&ne.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ne.languages.markup}}),(function(e){var n=/#(?!\{).+/,s={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:s}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:s}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:s}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(ne),(function(e){var n=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(n,"addSupport",{value:function(s,r){(s=typeof s=="string"?[s]:s).forEach(function(i){var o=function(m){m.inside||(m.inside={}),m.inside.rest=r},l="doc-comment";if(u=e.languages[i]){var u,d=u[l];if((d=d||(u=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[l])instanceof RegExp&&(d=u[l]={pattern:d}),Array.isArray(d))for(var p=0,f=d.length;p<f;p++)d[p]instanceof RegExp&&(d[p]={pattern:d[p]}),o(d[p]);else o(d)}})}}),n.addSupport(["java","javascript","php"],n)})(ne),(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,n=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(ne),(function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,n=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=n,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),s={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:s,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,number:s})})(ne),(function(e){var n=/[*&][^\s[\]{},]+/,s=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+s.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+s.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(u,d){d=(d||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return u});return RegExp(p,d)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:s,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(ne),(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(p){return p=p.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+p+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,l=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(p){["url","bold","italic","strike","code-snippet"].forEach(function(f){p!==f&&(e.languages.markdown[p].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(p){p.language!=="markdown"&&p.language!=="md"||(function f(m){if(m&&typeof m!="string")for(var x=0,y=m.length;x<y;x++){var j,k=m[x];k.type!=="code"?f(k.content):(j=k.content[1],k=k.content[3],j&&k&&j.type==="code-language"&&k.type==="code-block"&&typeof j.content=="string"&&(j=j.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),j="language-"+(j=(/[a-z][\w-]*/i.exec(j)||[""])[0].toLowerCase()),k.alias?typeof k.alias=="string"?k.alias=[k.alias,j]:k.alias.push(j):k.alias=[j]))}})(p.tokens)}),e.hooks.add("wrap",function(p){if(p.type==="code-block"){for(var f="",m=0,x=p.classes.length;m<x;m++){var y=p.classes[m],y=/language-(.+)/.exec(y);if(y){f=y[1];break}}var j,k=e.languages[f];k?p.content=e.highlight((function(b){return b=b.replace(l,""),b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(S,N){var $;return(N=N.toLowerCase())[0]==="#"?($=N[1]==="x"?parseInt(N.slice(2),16):Number(N.slice(1)),d($)):u[N]||S})})(p.content),k,f):f&&f!=="none"&&e.plugins.autoloader&&(j="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),p.attributes.id=j,e.plugins.autoloader.loadLanguages(f,function(){var b=document.getElementById(j);b&&(b.innerHTML=e.highlight(b.textContent,e.languages[f],f))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),u={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(ne),ne.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ne.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ne.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var n=e.tokens.filter(function(j){return typeof j!="string"&&j.type!=="comment"&&j.type!=="scalar"}),s=0;s<n.length;){var r=n[s++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(m(["definition-mutation","punctuation"])&&f(1).content==="("){s+=2;var o=x(/^\($/,/^\)$/);if(o===-1)continue;for(;s<o;s++){var l=f(0);l.type==="variable"&&(y(l,"variable-input"),i.push(l.content))}s=o+1}if(m(["punctuation","property-query"])&&f(0).content==="{"&&(s++,y(f(0),"property-mutation"),0<i.length)){var u=x(/^\{$/,/^\}$/);if(u!==-1)for(var d=s;d<u;d++){var p=n[d];p.type==="variable"&&0<=i.indexOf(p.content)&&y(p,"variable-input")}}}}function f(j){return n[s+j]}function m(j,k){k=k||0;for(var b=0;b<j.length;b++){var S=f(b+k);if(!S||S.type!==j[b])return}return 1}function x(j,k){for(var b=1,S=s;S<n.length;S++){var N=n[S],$=N.content;if(N.type==="punctuation"&&typeof $=="string"){if(j.test($))b++;else if(k.test($)&&--b===0)return S}}return-1}function y(j,k){var b=j.alias;b?Array.isArray(b)||(j.alias=b=[b]):j.alias=b=[],b.push(k)}}),ne.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var n=e.languages.javascript["template-string"],s=n.pattern.source,r=n.inside.interpolation,i=r.inside["interpolation-punctuation"],o=r.pattern.source;function l(m,x){if(e.languages[m])return{pattern:RegExp("((?:"+x+")\\s*)"+s),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:m}}}}function u(m,x,y){return m={code:m,grammar:x,language:y},e.hooks.run("before-tokenize",m),m.tokens=e.tokenize(m.code,m.grammar),e.hooks.run("after-tokenize",m),m.tokens}function d(m,x,y){var b=e.tokenize(m,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),j=0,k={},b=u(b.map(function(N){if(typeof N=="string")return N;for(var $,A,N=N.content;m.indexOf((A=j++,$="___"+y.toUpperCase()+"_"+A+"___"))!==-1;);return k[$]=N,$}).join(""),x,y),S=Object.keys(k);return j=0,(function N($){for(var A=0;A<$.length;A++){if(j>=S.length)return;var R,E,M,F,W,I,q,L=$[A];typeof L=="string"||typeof L.content=="string"?(R=S[j],(q=(I=typeof L=="string"?L:L.content).indexOf(R))!==-1&&(++j,E=I.substring(0,q),W=k[R],M=void 0,(F={})["interpolation-punctuation"]=i,(F=e.tokenize(W,F)).length===3&&((M=[1,1]).push.apply(M,u(F[1],e.languages.javascript,"javascript")),F.splice.apply(F,M)),M=new e.Token("interpolation",F,r.alias,W),F=I.substring(q+R.length),W=[],E&&W.push(E),W.push(M),F&&(N(I=[F]),W.push.apply(W,I)),typeof L=="string"?($.splice.apply($,[A,1].concat(W)),A+=W.length-1):L.content=W)):(q=L.content,Array.isArray(q)?N(q):N([q]))}})(b),new e.Token(y,b,"language-"+y,m)}e.languages.javascript["template-string"]=[l("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),l("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),l("svg",/\bsvg/.source),l("markdown",/\b(?:markdown|md)/.source),l("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),l("sql",/\bsql/.source),n].filter(Boolean);var p={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(m){return typeof m=="string"?m:Array.isArray(m)?m.map(f).join(""):f(m.content)}e.hooks.add("after-tokenize",function(m){m.language in p&&(function x(y){for(var j=0,k=y.length;j<k;j++){var b,S,N,$=y[j];typeof $!="string"&&(b=$.content,Array.isArray(b)?$.type==="template-string"?($=b[1],b.length===3&&typeof $!="string"&&$.type==="embedded-code"&&(S=f($),$=$.alias,$=Array.isArray($)?$[0]:$,N=e.languages[$])&&(b[1]=d(S,N,$))):x(b):typeof b!="string"&&x([b]))}})(m.tokens)})})(ne),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript})(ne),(function(e){var n=e.languages.javascript,s=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+s+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:n,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return s})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+s),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(ne),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ne),ne.languages.n4js=ne.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ne.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ne.languages.n4jsd=ne.languages.n4js,(function(e){function n(l,u){return RegExp(l.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),u)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:n(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var s=["function","function-variable","method","method-variable","property-access"],r=0;r<s.length;r++){var o=s[r],i=e.languages.javascript[o],o=(i=e.util.type(i)==="RegExp"?e.languages.javascript[o]={pattern:i}:i).inside||{};(i.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ne),(function(e){var n=e.util.clone(e.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(d,p){return d=d.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(d,p)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",n),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=n.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function l(d){for(var p=[],f=0;f<d.length;f++){var m=d[f],x=!1;typeof m!="string"&&(m.type==="tag"&&m.content[0]&&m.content[0].type==="tag"?m.content[0].content[0].content==="</"?0<p.length&&p[p.length-1].tagName===u(m.content[0].content[1])&&p.pop():m.content[m.content.length-1].content!=="/>"&&p.push({tagName:u(m.content[0].content[1]),openedBraces:0}):0<p.length&&m.type==="punctuation"&&m.content==="{"?p[p.length-1].openedBraces++:0<p.length&&0<p[p.length-1].openedBraces&&m.type==="punctuation"&&m.content==="}"?p[p.length-1].openedBraces--:x=!0),(x||typeof m=="string")&&0<p.length&&p[p.length-1].openedBraces===0&&(x=u(m),f<d.length-1&&(typeof d[f+1]=="string"||d[f+1].type==="plain-text")&&(x+=u(d[f+1]),d.splice(f+1,1)),0<f&&(typeof d[f-1]=="string"||d[f-1].type==="plain-text")&&(x=u(d[f-1])+x,d.splice(f-1,1),f--),d[f]=new e.Token("plain-text",x,null,x)),m.content&&typeof m.content!="string"&&l(m.content)}}var u=function(d){return d?typeof d=="string"?d:typeof d.content=="string"?d.content:d.content.map(u).join(""):""};e.hooks.add("after-tokenize",function(d){d.language!=="jsx"&&d.language!=="tsx"||l(d.tokens)})})(ne),(function(e){var n=e.util.clone(e.languages.typescript),n=(e.languages.tsx=e.languages.extend("jsx",n),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0})(ne),ne.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ne.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ne.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(ne),ne.languages.c=ne.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ne.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ne.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ne.languages.c.string],char:ne.languages.c.char,comment:ne.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ne.languages.c}}}}),ne.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ne.languages.c.boolean,ne.languages.objectivec=ne.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ne.languages.objectivec["class-name"],ne.languages.objc=ne.languages.objectivec,ne.languages.reason=ne.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ne.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ne.languages.reason.function,(function(e){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,s=0;s<2;s++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(ne),ne.languages.go=ne.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ne.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ne.languages.go["class-name"],(function(e){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,s=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return s})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(ne),ne.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ne.languages.python["string-interpolation"].inside.interpolation.inside.rest=ne.languages.python,ne.languages.py=ne.languages.python,ne.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ne.languages.webmanifest=ne.languages.json;var Eo={};qA(Eo,{dracula:()=>WA,duotoneDark:()=>HA,duotoneLight:()=>KA,github:()=>GA,gruvboxMaterialDark:()=>NP,gruvboxMaterialLight:()=>CP,jettwaveDark:()=>gP,jettwaveLight:()=>yP,nightOwl:()=>ZA,nightOwlLight:()=>JA,oceanicNext:()=>tP,okaidia:()=>sP,oneDark:()=>kP,oneLight:()=>bP,palenight:()=>iP,shadesOfPurple:()=>oP,synthwave84:()=>cP,ultramin:()=>dP,vsDark:()=>fb,vsLight:()=>fP});var BA={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},WA=BA,UA={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},HA=UA,VA={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},KA=VA,YA={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},GA=YA,QA={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},ZA=QA,XA={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},JA=XA,kn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},eP={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:kn.keyword}},{types:["attr-value"],style:{color:kn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:kn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:kn.primitive}},{types:["boolean"],style:{color:kn.boolean}},{types:["tag"],style:{color:kn.tag}},{types:["string"],style:{color:kn.string}},{types:["punctuation"],style:{color:kn.string}},{types:["selector","char","builtin","inserted"],style:{color:kn.char}},{types:["function"],style:{color:kn.function}},{types:["operator","entity","url","variable"],style:{color:kn.variable}},{types:["keyword"],style:{color:kn.keyword}},{types:["atrule","class-name"],style:{color:kn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},tP=eP,nP={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},sP=nP,rP={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},iP=rP,aP={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},oP=aP,lP={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},cP=lP,uP={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},dP=uP,hP={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},fb=hP,pP={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},fP=pP,mP={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},gP=mP,xP={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},yP=xP,jP={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},kP=jP,vP={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},bP=vP,wP={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},NP=wP,SP={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},CP=SP,$P=e=>C.useCallback(n=>{var s=n,{className:r,style:i,line:o}=s,l=pb(s,["className","style","line"]);const u=Du(ys({},l),{className:ub("token-line",r)});return typeof e=="object"&&"plain"in e&&(u.style=e.plain),typeof i=="object"&&(u.style=ys(ys({},u.style||{}),i)),u},[e]),TP=e=>{const n=C.useCallback(({types:s,empty:r})=>{if(e!=null){{if(s.length===1&&s[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(s.length===1&&r!=null)return e[s[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...s.map(i=>e[i]))}},[e]);return C.useCallback(s=>{var r=s,{token:i,className:o,style:l}=r,u=pb(r,["token","className","style"]);const d=Du(ys({},u),{className:ub("token",...i.types,o),children:i.content,style:n(i)});return l!=null&&(d.style=ys(ys({},d.style||{}),l)),d},[n])},EP=/\r\n|\r|\n/,c2=e=>{e.length===0?e.push({types:["plain"],content:`
612
+ `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
613
+ `,e[0].empty=!0)},u2=(e,n)=>{const s=e.length;return s>0&&e[s-1]===n?e:e.concat(n)},AP=e=>{const n=[[]],s=[e],r=[0],i=[e.length];let o=0,l=0,u=[];const d=[u];for(;l>-1;){for(;(o=r[l]++)<i[l];){let p,f=n[l];const x=s[l][o];if(typeof x=="string"?(f=l>0?f:["plain"],p=x):(f=u2(f,x.type),x.alias&&(f=u2(f,x.alias)),p=x.content),typeof p!="string"){l++,n.push(f),s.push(p),r.push(0),i.push(p.length);continue}const y=p.split(EP),j=y.length;u.push({types:f,content:y[0]});for(let k=1;k<j;k++)c2(u),d.push(u=[]),u.push({types:f,content:y[k]})}l--,n.pop(),s.pop(),r.pop(),i.pop()}return c2(u),d},d2=AP,PP=({prism:e,code:n,grammar:s,language:r})=>C.useMemo(()=>{if(s==null)return d2([n]);const i={code:n,grammar:s,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(n,s),e.hooks.run("after-tokenize",i),d2(i.tokens)},[n,s,r,e]),RP=(e,n)=>{const{plain:s}=e,r=e.styles.reduce((i,o)=>{const{languages:l,style:u}=o;return l&&!l.includes(n)||o.types.forEach(d=>{const p=ys(ys({},i[d]),u);i[d]=p}),i},{});return r.root=s,r.plain=Du(ys({},s),{backgroundColor:void 0}),r},IP=RP,FP=({children:e,language:n,code:s,theme:r,prism:i})=>{const o=n.toLowerCase(),l=IP(r,o),u=$P(l),d=TP(l),p=i.languages[o],f=PP({prism:i,language:o,code:s,grammar:p});return e({tokens:f,className:`prism-code language-${o}`,style:l!=null?l.root:{},getLineProps:u,getTokenProps:d})},mb=e=>C.createElement(FP,Du(ys({},e),{prism:e.prism||ne,theme:e.theme||fb,code:e.code,language:e.language}));/*! Bundled license information:
614
+
615
+ prismjs/prism.js:
616
+ (**
617
+ * Prism: Lightweight, robust, elegant syntax highlighting
618
+ *
619
+ * @license MIT <https://opensource.org/licenses/MIT>
620
+ * @author Lea Verou <https://lea.verou.me>
621
+ * @namespace
622
+ * @public
623
+ *)
624
+ */const zP=/^\s*(?:flowchart|graph)\s*(LR|RL|TD|TB|BT)?\s*;?\s*$/i,LP=/^([A-Za-z0-9_؀-ۿ-]+)\s*(\[\[(.+?)\]\]|\(\[(.+?)\]\)|\(\((.+?)\)\)|\[(.+?)\]|\((.+?)\)|\{(.+?)\}|>(.+?)\])?/,MP=/^\s*(-->|---|-\.->|-\.-|==>|===|--\s*(.+?)\s*-->|-\.\s*(.+?)\s*\.->|==\s*(.+?)\s*==>)\s*(?:\|(.+?)\|)?\s*/;function h2(e){return e.replace(/^["']|["']$/g,"").replace(/<br\s*\/?>/gi," ").trim()}function qP(e){const n=e.split(`
625
+ `).map(x=>x.replace(/%%.*$/,"").trim()).filter(Boolean),s=n.shift()?.match(zP);if(!s)return null;const r=(s[1]??"TD").toUpperCase(),i=new Map,o=[],l=x=>{const y=x.match(LP);if(!y)return null;const j=y[1],k=y[3]??y[4]??y[5]??y[6]??y[7]??y[8]??y[9],b=y[8]?"decision":y[6]||y[3]?"box":k?"round":"box",S=i.get(j);return(!S||k)&&i.set(j,{id:j,text:h2(k??S?.text??j),shape:k?b:S?.shape??b}),{id:j,rest:x.slice(y[0].length)}};for(const x of n)if(!/^(classDef|class|style|linkStyle|click|subgraph|end|direction)\b/.test(x))for(const y of x.split(";").map(j=>j.trim()).filter(Boolean)){let j=l(y);if(!j)continue;let k=j.rest;for(;;){const b=k.match(MP);if(!b)break;const S=l(k.slice(b[0].length));if(!S)break;const N=h2(b[5]??b[2]??b[3]??b[4]??"");o.push({from:j.id,to:S.id,...N?{label:N}:{},...b[1].includes(".")?{dashed:!0}:{}}),j=S,k=S.rest}}if(!i.size)return null;const u=new Map([...i.keys()].map(x=>[x,0]));for(let x=0;x<i.size;x+=1){let y=!1;for(const j of o){if(j.from===j.to)continue;const k=(u.get(j.from)??0)+1;k>(u.get(j.to)??0)&&k<i.size&&(u.set(j.to,k),y=!0)}if(!y)break}const d=new Map,p=[...i.values()].map(x=>{const y=u.get(x.id)??0,j=d.get(y)??0;return d.set(y,j+1),{...x,rank:y,slot:j}}),f=r==="RL"||r==="BT",m=Math.max(...p.map(x=>x.rank));return{across:r==="LR"||r==="RL",nodes:f?p.map(x=>({...x,rank:m-x.rank})):p,edges:o}}function oi({pictures:e,start:n,onClose:s}){const[r,i]=C.useState(n),o=e.length,l=C.useCallback(d=>i(p=>(p+d+o)%o),[o]);C.useEffect(()=>{const d=p=>{p.key==="Escape"?s():p.key==="ArrowRight"?l(1):p.key==="ArrowLeft"&&l(-1)};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[s,l]);const u=e[r];return u?t.jsxs("div",{className:"lightbox",role:"dialog","aria-modal":"true","aria-label":u.caption,onMouseDown:d=>d.target===d.currentTarget&&s(),children:[t.jsxs("div",{className:"lb-top",children:[t.jsx(D,{className:"lb-cap",text:u.caption}),o>1&&t.jsxs("span",{className:"lb-count",children:[r+1," of ",o]}),t.jsx("span",{className:"grow"}),t.jsx("a",{className:"iconbtn",href:u.src,target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",title:"Open in a new tab",children:t.jsx(xs,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:s,"aria-label":"Close",children:t.jsx(Qe,{size:16})})]}),t.jsx("img",{className:"lb-img",src:u.src,alt:u.caption,onMouseDown:d=>d.stopPropagation()}),o>1&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"lb-nav prev",onClick:()=>l(-1),"aria-label":"Previous picture",children:t.jsx(ak,{size:22})}),t.jsx("button",{className:"lb-nav next",onClick:()=>l(1),"aria-label":"Next picture",children:t.jsx(Tu,{size:22})})]})]}):null}function _m({src:e,alt:n,className:s}){const[r,i]=C.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"zoom",onClick:()=>i(!0),"aria-label":`Open ${n} full size`,children:t.jsx("img",{className:s,src:e,alt:n,loading:"lazy"})}),r&&t.jsx(oi,{pictures:[{src:e,caption:n}],start:0,onClose:()=>i(!1)})]})}function Ao({text:e,ticket:n,stream:s,caret:r}){const[i,o]=C.useState(null),l=C.useMemo(()=>[[cm,{stream:s,caret:r}]],[s,r]);return t.jsxs("div",{className:"cmd",children:[t.jsx(Im,{remarkPlugins:[qm],rehypePlugins:l,components:{a:({href:u,children:d})=>t.jsx("a",{href:u,target:"_blank",rel:"noreferrer",children:d}),img:({src:u,alt:d})=>{const p=u?/^(https?:|data:)/.test(u)?u:wn(n,u):"";return t.jsx("button",{className:"cimg",onClick:()=>o(p),"aria-label":`Open ${d||"the picture"} big`,children:t.jsx("img",{src:p,alt:d??"",loading:"lazy"})})},table:({node:u,children:d})=>t.jsx("div",{className:"ctable",children:t.jsx("table",{dir:u?.properties?.dir??void 0,children:d})}),pre:({node:u})=>t.jsx(OP,{node:u})},children:e}),i&&t.jsx(oi,{pictures:[{src:i,caption:"Picture"}],start:0,onClose:()=>o(null)})]})}function gb(e){return e.type==="text"?e.value??"":(e.children??[]).map(gb).join("")}function OP({node:e}){const n=e.children?.find(o=>o.tagName==="code"),r=(n?.properties?.className??[]).find(o=>o.startsWith("language-"))?.slice(9)??"",i=gb(n??e).replace(/\n$/,"");if(r==="mermaid"){const o=qP(i);if(o)return t.jsx(DP,{chart:o})}return t.jsx(_P,{lang:r==="mermaid"?"Diagram (Mermaid)":r,code:i})}function _P({lang:e,code:n}){const{theme:s,toast:r}=Le(),i=()=>void navigator.clipboard?.writeText(n).then(()=>r("Code copied"),()=>r("Could not copy. Select the text instead.","err"));return t.jsxs("div",{className:"ccode",dir:"ltr",children:[t.jsxs("div",{className:"ccode-h",children:[t.jsx("span",{children:e||"text"}),t.jsxs("button",{className:"cact",onClick:i,"aria-label":"Copy the code",children:[t.jsx(os,{size:13})," Copy"]})]}),t.jsx(mb,{code:n,language:e||"text",theme:s==="dark"?Eo.vsDark:Eo.github,children:({tokens:o,getLineProps:l,getTokenProps:u})=>t.jsx("pre",{children:o.map((d,p)=>t.jsx("div",{...l({line:d}),children:d.map((f,m)=>t.jsx("span",{...u({token:f})},m))},p))})})]})}function DP({chart:e}){const n=C.useRef(null),[s,r]=C.useState([]),i=C.useMemo(()=>{const l=[];for(const u of e.nodes)(l[u.rank]??=[]).push(u);return l.map(u=>(u??[]).sort((d,p)=>d.slot-p.slot))},[e]),o=C.useMemo(()=>new Set(e.nodes.filter(l=>!e.edges.some(u=>u.from===l.id)).map(l=>l.id)),[e]);return C.useLayoutEffect(()=>{const l=n.current;if(!l)return;const u=()=>{const p=l.getBoundingClientRect(),f=m=>l.querySelector(`[data-node="${CSS.escape(m)}"]`)?.getBoundingClientRect();r(e.edges.flatMap(m=>{const x=f(m.from),y=f(m.to);if(!x||!y)return[];const j=e.across?y.left>=x.right-1:y.top>=x.bottom-1;let k,b,S,N,$;if(e.across){k=(j?x.right:x.left)-p.left,b=x.top+x.height/2-p.top,S=(j?y.left:y.right)-p.left,N=y.top+y.height/2-p.top;const A=Math.max(24,Math.abs(S-k)/2)*(j?1:-1);$=`M${k},${b} C${k+A},${b} ${S-A},${N} ${S},${N}`}else{k=x.left+x.width/2-p.left,b=(j?x.bottom:x.top)-p.top,S=y.left+y.width/2-p.left,N=(j?y.top:y.bottom)-p.top;const A=Math.max(18,Math.abs(N-b)/2)*(j?1:-1);$=`M${k},${b} C${k},${b+A} ${S},${N-A} ${S},${N}`}return[{d:$,x:(k+S)/2,y:(b+N)/2,...m.label?{label:m.label}:{},...m.dashed?{dashed:!0}:{}}]}))};u();const d=new ResizeObserver(u);return d.observe(l),()=>d.disconnect()},[e]),t.jsx("div",{className:"cdiagram",dir:"ltr",children:t.jsxs("div",{ref:n,className:`cflow ${e.across?"across":"down"}`,children:[t.jsxs("svg",{className:"cflow-lines","aria-hidden":"true",children:[t.jsx("defs",{children:t.jsx("marker",{id:"cflow-arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L10,5 L0,10 z"})})}),s.map((l,u)=>t.jsx("path",{d:l.d,className:l.dashed?"dash":"",markerEnd:"url(#cflow-arrow)"},u))]}),i.map((l,u)=>t.jsx("div",{className:"cflow-rank",children:l.map(d=>t.jsx("span",{"data-node":d.id,className:`cnode ${d.shape} ${o.has(d.id)&&d.shape!=="decision"?"end":""}`,children:t.jsx("bdi",{children:d.text})},d.id))},u)),s.map((l,u)=>l.label?t.jsx("span",{className:"cflow-label",style:{left:l.x,top:l.y},children:l.label},u):null)]})})}function BP({lines:e,children:n}){const[s,r]=C.useState(!1);return e<=26?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{className:`cfold ${s?"open":""}`,children:[t.jsx("div",{className:"cfold-body",children:n}),t.jsx("button",{className:"btn sm",onClick:()=>r(!s),children:s?"Show less":`Show all · ${e} lines`})]})}function WP(e){return e.split(`
626
+ `).reduce((n,s)=>n+(s.trim()?Math.ceil(s.length/80):0),0)}const p2=/\.(png|jpe?g|gif|webp)$/i,f2=/\.html?$/i;function xb({ticket:e,files:n}){const s=n.filter(o=>p2.test(o)),r=n.filter(o=>f2.test(o)),i=n.filter(o=>!p2.test(o)&&!f2.test(o));return t.jsxs("div",{className:"attached",children:[r.map(o=>t.jsx(Dm,{ticket:e,file:o},o)),s.length>0&&t.jsx("div",{className:"attpics",children:s.map(o=>t.jsx(_m,{src:wn(e,o),alt:m2(o)},o))}),i.map(o=>t.jsxs("a",{className:"btn sm",href:wn(e,o),download:!0,children:[t.jsx(ks,{size:13})," ",m2(o)]},o))]})}function Dm({ticket:e,file:n,title:s="Mockup"}){const[r,i]=C.useState(!1),o=$e({queryKey:["mockup-link",e,n],queryFn:()=>Se(`/api/v1/tickets/${encodeURIComponent(e)}/mockup-link?path=${encodeURIComponent(n)}`),staleTime:1/0});if(o.isError)return t.jsx("p",{className:"note",children:"The mockup could not be read."});const l=u=>t.jsx("iframe",{className:u,title:s,sandbox:"allow-scripts",src:o.data?.url??"about:blank"});return t.jsxs("div",{className:"mockup",children:[t.jsxs("div",{className:"mockbar",children:[t.jsxs("span",{children:[s," · click around, it is only a picture of the idea"]}),t.jsxs("button",{className:"btn sm",onClick:()=>i(!0),children:[t.jsx(Au,{size:12})," Full size"]})]}),l("mockframe"),r&&t.jsx(He,{title:s,wide:!0,onClose:()=>i(!1),children:l("mockframe big")})]})}function m2(e){return e.split(/[\\/]/).pop()??e}const bf=/\.(png|jpe?g|gif|webp|bmp)$/i,g2=/\.(mp4|webm|mov|m4v)$/i,wf=/\.(ogg|opus|oga|m4a|mp3|wav|aac|amr|flac|weba)$/i,yb=/\.(md|markdown)$/i,jb=/\.pdf$/i,kb=/\.html?$/i;function Fs(e){return e.split(/[\\/]/).pop()??e}function vb(e){return yb.test(e)?{cls:"md",label:"MD"}:jb.test(e)?{cls:"pdf",label:"PDF"}:kb.test(e)?{cls:"html",label:"HTML"}:bf.test(e)?{cls:"img",label:(e.split(".").pop()??"IMG").toUpperCase().slice(0,4)}:{cls:"file",label:(e.split(".").pop()??"FILE").toUpperCase().slice(0,4)}}function Bm({ticket:e,files:n,from:s,onOpen:r,sent:i}){const[o,l]=C.useState(null),[u,d]=C.useState(null),p=n.filter(y=>bf.test(y)),f=n.filter(y=>g2.test(y)),m=n.filter(y=>wf.test(y)),x=n.filter(y=>!bf.test(y)&&!g2.test(y)&&!wf.test(y)&&!/\.transcript\.txt$/.test(y));return t.jsxs("div",{className:"cfiles",children:[p.length>0&&t.jsx("div",{className:"cshots",children:p.map((y,j)=>t.jsxs("button",{className:"cshot",onClick:()=>l(j),"aria-label":`Open ${Fs(y)} big`,children:[t.jsx("img",{src:wn(e,y),alt:Fs(y),loading:"lazy"}),i&&t.jsx("span",{className:"cshot-ok",title:"Sent",children:t.jsx(ge,{size:11,strokeWidth:3})})]},y))}),f.map(y=>t.jsxs("div",{className:"cvideo",children:[t.jsx("video",{src:wn(e,y),controls:!0,preload:"metadata"}),t.jsx(bb,{ticket:e,file:y})]},y)),m.map(y=>t.jsx(HP,{ticket:e,file:y},y)),x.map(y=>{const j=vb(y),k=yb.test(y),b=jb.test(y),S=kb.test(y),N=k?"Markdown · opens beside the chat":b?"PDF · opens beside the chat":S?"Mockup · runs here, sealed off":"File · downloads",$=t.jsxs(t.Fragment,{children:[t.jsx("span",{className:`cfic ${j.cls}`,children:j.label}),t.jsxs("span",{className:"cfile-t",children:[t.jsx("span",{className:"cfname",children:Fs(y)}),t.jsx("span",{className:"cfmeta",children:N})]}),t.jsx("span",{className:"cfopen",children:k||b||S?"Open":t.jsx(ks,{size:14})})]});return k||b?t.jsx("button",{className:"cfile",onClick:()=>r?.({ticket:e,file:y,kind:k?"md":"pdf",...s?{from:s}:{}}),children:$},y):S?t.jsx("button",{className:"cfile",onClick:()=>d(y),children:$},y):t.jsx("a",{className:"cfile",href:wn(e,y),download:!0,children:$},y)}),o!==null&&t.jsx(oi,{pictures:p.map(y=>({src:wn(e,y),caption:Fs(y)})),start:o,onClose:()=>l(null)}),u&&t.jsx(He,{title:Fs(u),wide:!0,onClose:()=>d(null),children:t.jsx(Dm,{ticket:e,file:u,title:Fs(u)})})]})}function UP(e,n){return $e({queryKey:["transcript",e,n],queryFn:async()=>{const s=await fetch(wn(e,`${n}.transcript.txt`));return s.ok&&(await s.text()).replace(/^Transcript of [^\n]*\n+/,"").trim()||null},staleTime:3e4,refetchInterval:s=>s.state.data?!1:1e4})}function bb({ticket:e,file:n,open:s=!0}){const r=UP(e,n).data,[i,o]=C.useState(s);return r?t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"ctlink",onClick:()=>o(!i),children:i?"Hide the written text":"Show the written text"}),i&&t.jsx("div",{className:"ctrans",children:r.split(/\n+/).map((l,u)=>{const d=ht(l);return t.jsx("p",{dir:d.dir,lang:d.dir==="rtl"?"ar":"en",className:Bs(d),children:l},u)})})]}):null}function HP({ticket:e,file:n}){const s=C.useRef(null),[r,i]=C.useState(!1),[o,l]=C.useState({at:0,length:0}),u=C.useMemo(()=>{let m=7;for(const x of n)m=(m*31+x.charCodeAt(0))%9973;return Array.from({length:34},(x,y)=>6+m*(y+3)*7%19)},[n]);C.useEffect(()=>{const m=s.current;if(!m)return;const x=()=>l({at:m.currentTime,length:Number.isFinite(m.duration)?m.duration:0}),y=()=>i(!1);return m.addEventListener("timeupdate",x),m.addEventListener("loadedmetadata",x),m.addEventListener("ended",y),()=>{m.removeEventListener("timeupdate",x),m.removeEventListener("loadedmetadata",x),m.removeEventListener("ended",y)}},[]);const d=()=>{const m=s.current;m&&(r?m.pause():m.play().catch(()=>i(!1)),i(!r))},p=r||o.at>0?o.at:o.length,f=o.length?Math.min(1,o.at/o.length):0;return t.jsxs("div",{className:"cvoice-w",children:[t.jsxs("div",{className:"cvoice",children:[t.jsx("button",{className:"cplay",onClick:d,"aria-label":r?"Pause the voice note":"Play the voice note",children:r?t.jsx(Pu,{size:15,fill:"currentColor"}):t.jsx(Sn,{size:15,fill:"currentColor"})}),t.jsx("div",{className:"cwave","aria-hidden":"true",children:u.map((m,x)=>t.jsx("i",{style:{height:m},className:x/u.length<f?"on":""},x))}),t.jsx("span",{className:"cvt",children:VP(p)}),t.jsx("audio",{ref:s,src:wn(e,n),preload:"metadata"})]}),t.jsx(bb,{ticket:e,file:n})]})}function VP(e){const n=Math.max(0,Math.round(e));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Wm({doc:e,onClose:n}){const{toast:s}=Le(),r=wn(e.ticket,e.file),i=$e({queryKey:["doc",e.ticket,e.file],queryFn:async()=>{const u=await fetch(r);if(!u.ok)throw new Error("The file could not be read.");return u.text()},enabled:e.kind==="md"}),o=vb(e.file),l=()=>void navigator.clipboard?.writeText(i.data??"").then(()=>s("Document copied"));return t.jsxs("section",{className:"cdoc","aria-label":Fs(e.file),children:[t.jsxs("div",{className:"cdoc-h",children:[t.jsx("span",{className:`cfic sm ${o.cls}`,children:o.label}),t.jsxs("div",{className:"grow",children:[t.jsx("div",{className:"cfname",children:Fs(e.file)}),t.jsx("div",{className:"cfmeta",children:e.from??(e.kind==="md"?"Markdown":"PDF")})]}),e.kind==="md"&&t.jsx("button",{className:"btn sm",onClick:l,disabled:!i.data,children:"Copy"}),e.kind==="pdf"&&t.jsx("a",{className:"btn sm",href:r,target:"_blank",rel:"noreferrer",children:"Open in a tab"}),t.jsx("button",{className:"iconbtn",onClick:n,"aria-label":"Close the document",children:t.jsx(Qe,{size:16})})]}),e.kind==="md"?t.jsx("div",{className:"cdoc-b",children:i.isError?t.jsx("p",{className:"note",children:"The file could not be read."}):i.data?t.jsx(Ao,{text:i.data,ticket:e.ticket}):t.jsx("p",{className:"note",children:"Loading…"})}):t.jsx("iframe",{className:"cdoc-pdf",src:r,title:Fs(e.file)})]})}function wb(e){const n=[],s=new Map;for(const{at:r,update:i}of e)switch(i.sessionUpdate){case"user_message_chunk":{const o=i.content.type==="text"&&i.content._meta?.squadKit?.from==="claude-code"?"claude-code":"squad-kit";n.push({kind:"message",from:o,content:i.content,at:r});break}case"agent_message_chunk":n.push({kind:"message",from:"agent",content:i.content,at:r});break;case"agent_thought_chunk":n.push({kind:"message",from:"thought",content:i.content,at:r});break;case"plan":n.push({kind:"plan",entries:i.entries,at:r});break;case"tool_call":{const o={kind:"tool",id:i.toolCallId,title:i.title,toolKind:i.kind??"other",status:i.status??"in_progress",content:[...i.content??[]],command:i.rawInput?.command,at:r};s.set(i.toolCallId,o),n.push(o);break}case"tool_call_update":{const o=s.get(i.toolCallId);if(!o)break;i.status&&(o.status=i.status),i.title&&(o.title=i.title),i.kind&&(o.toolKind=i.kind),i.rawInput?.command&&(o.command=i.rawInput.command),i.content&&(o.content=[...i.content]),i._meta?.squadKit?.blocked?.length&&(o.blocked=i._meta.squadKit.blocked);break}}for(const r of s.values())XP(r);return n}const KP=/^(StructuredOutput|Gave squad-kit its answer|Handed in its answer)$/,YP=/^structured output provided successfully\.?$/i,x2=/User refused permission to run tool|^Permission denied: |haven't granted it yet/i;function Np(e){return e.type==="content"&&e.content.type==="text"?e.content.text.trim():""}function GP(e){return e==="execute"?"Skipped a command this step may not run":e==="edit"||e==="delete"||e==="move"?"Skipped a change this step may not make":"Skipped something this step may not do"}const QP={bash:"Ran a command",terminal:"Ran a command",read:"Read a file",write:"Wrote a file",edit:"Changed a file",multiedit:"Changed a file",notebookedit:"Changed a notebook",glob:"Looked for files",grep:"Searched the code",ls:"Listed a folder",todowrite:"Updated its plan",task:"Asked a helper",agent:"Asked a helper",webfetch:"Opened a web page",fetch:"Opened a web page",websearch:"Searched the web","web search":"Searched the web",enterplanmode:"Planned its work",exitplanmode:"Planned its work","exited plan mode":"Planned its work","approve plan":"Planned its work","unknown tool":"Used a tool"};function ZP(e){const n=e.trim(),s=QP[n.toLowerCase()];if(s)return s;const r=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(n);return r?`Used ${r[2].replace(/_/g," ")} from ${r[1].replace(/_/g," ")}`:/^[A-Z][a-z]+(?:[A-Z][a-z]+)+$/.test(n)?`Used ${n.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}`:null}function XP(e){if(e.toolKind==="execute"&&e.command&&e.title.trim()===e.command.trim()&&(e.title=`Ran ${e.command.split(`
627
+ `)[0].slice(0,80)}`),KP.test(e.title)){e.answer=!0,e.title="Handed in its answer",e.content=e.content.filter(s=>!YP.test(Np(s)));return}if(e.status==="failed"&&e.content.some(s=>x2.test(Np(s)))){e.skipped=!0,e.detail=e.title,e.title=GP(e.toolKind),e.content=e.content.filter(s=>!x2.test(Np(s)));return}const n=ZP(e.title);n&&(e.title=n)}function oa(e){const n=e.waiting?.kind;if(n==="proof")return!0;if(n!=="stuck")return!1;const s=e.stuck?.gate;return s==="checks"||s==="review"||s==="proof"||s==="merge"||e.stage==="test"||e.stage==="review"}function Gr(e){const n=e.page?.trim()??"";if(!n)return"";const s=n.replace(/^[a-z]+:\/\/[^/]+/i,"");return s.startsWith("/")?s:`/${s}`}function fu(e){return[...new Set([e,...e.more??[]].map(Gr).filter(Boolean))]}function JP(e){return[...new Set((e.proof??[]).flatMap(fu))]}const eR={analyst:"intake",builder:"build",tester:"tester"},tR=new Set(["implement","test","review","release","done"]),nR="Next in line";function sR(e,n=!0){const s=e.proof?.length?"tester":e.sessions?.build||tR.has(e.stage)?"builder":"analyst";return s==="analyst"||!n||e.sessions?.[eR[s]]?s:"analyst"}function Nb(e){return!e.waiting&&(e.status??"").startsWith(nR)}function rR(e){return!!(e.live||e.squad)&&!e.waiting&&!e.takenOver&&!Nb(e)}const iR={architect:"Architect",builder:"Builder",reviewer:"Reviewer"},aR={tickets:"is being read",specs:"is being planned",implement:"is being built",test:"is being checked",review:"is being reviewed",release:"is accepted",bugs:"is being looked into",done:"is released"};function oR(e){const n=e.id;if(e.stage==="done")return`${n} is released${e.release?` in ${e.release}`:""}`;if(e.stage==="release")return`${n} is accepted${e.release?` and goes out in ${e.release}`:""}`;if(e.takenOver?.free)return`${n} is in a conversation outside squad-kit, and the squad waits until it comes back`;if(e.takenOver)return`You have ${n}, and the squad waits until you give it back`;const s=(e.dependsOn?.length?e.dependsOn:e.dependency?.on??[]).join(", ");switch(e.waiting?.kind){case"proof":return`${n} waits for your check`;case"stuck":return oa(e)?`${n} stopped at a check and waits for your decision`:`${n} stopped and waits for your decision`;case"ask":return`${n} waits for your answer to the ${e.agentQuestion?iR[e.agentQuestion.from]:"squad"}'s question`;case"depends":return`${n} waits for ${s||"another story"} to be merged`;case"questions":return`${n} waits for your answers to the questions`;case"spec":return`${n}'s spec waits for your approval`;case"plan":return`${n}'s design waits for your approval`;case"change":return`${n} waits for you to decide on the design update`;case"release":return`${n} waits for you to release it`;case"chat":return`${n} waits while you talk it through`;case"yours":return`You have ${n}, and the squad waits until you give it back`}return e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad?`${n} waits for ${s||"another story"} to be merged`:Nb(e)?`${n} waits in the queue`:e.live||e.squad?`${n} ${aR[e.stage]}`:e.stage==="tickets"||e.stage==="bugs"?`${n} has not started yet`:`${n} is not running right now`}const Sb="squad.draft.",lR=720*60*60*1e3,Gi=new Map;function il(){try{return window.localStorage}catch{return null}}function Qi(e,n,s){return`${Sb}${e??"app"}.${n}.${s}`}function cR(e,n){const s=Gi.get(e);if(s!==void 0)return s;try{return n?.getItem(e)??null}catch{return null}}function Po(e,n=il(),s=Date.now()){const r=cR(e,n);if(r)try{const{v:i,at:o}=JSON.parse(r);return s-o>lR?void 0:i}catch{return}}function Um(e,n,s=il(),r=Date.now()){const i=JSON.stringify({v:n,at:r});try{if(!s)throw new Error("no storage");s.setItem(e,i),Gi.delete(e)}catch{Gi.set(e,i)}}function Ro(e,n=il()){Gi.delete(e);try{n?.removeItem(e)}catch{}}function y2(e,n,s=il()){const r=Qi(e,n,"");for(const i of[...Gi.keys()])i.startsWith(r)&&Gi.delete(i);if(s)try{const i=[];for(let o=0;o<s.length;o+=1){const l=s.key(o);l?.startsWith(r)&&i.push(l)}for(const o of i)s.removeItem(o)}catch{}}function uR(e=il(),n=Date.now()){if(e)try{const s=[];for(let r=0;r<e.length;r+=1){const i=e.key(r);i?.startsWith(Sb)&&Po(i,e,n)===void 0&&s.push(i)}for(const r of s)e.removeItem(r)}catch{}}function j2(e,n,s){const r=Qi(wt,e,n),i=Po(r);if(i)return i;const o=s();return Um(r,o),o}function Ne(e,n,s){const r=Qi(wt,e,n),i=C.useRef(JSON.stringify(s)),[o,l]=C.useState(()=>Po(r)??s),u=C.useRef(r);u.current!==r&&(u.current=r,i.current=JSON.stringify(s),l(Po(r)??s)),C.useEffect(()=>{JSON.stringify(o)===i.current?Ro(r):Um(r,o)},[r,o]);const d=C.useCallback(()=>{Ro(r),l(s)},[r]);return[o,l,d]}function al(e){return e.owner?.trim()||e.createdBy}function mu(e,n){return!!e?.trim()&&e.trim().toLowerCase()===n?.trim().toLowerCase()}function la(){const e=Ke();return e.data?.ready?e.data.meta.user?.name:void 0}function _n(e,n){return mu(al(e),n)}function dR(e,n){return _n(e,n)&&!e.takenOver&&e.stage!=="release"&&e.stage!=="done"}function hR({t:e,onClose:n}){const s=pe(),r=pe(),i=Ke(),o=la(),[l,u,d]=Ne(e.id,"hand-over-to",""),[p,f,m]=Ne(e.id,"hand-over-note",""),x=i.data?.ready?i.data.meta.engine==="live":!0;e.branch??`${e.id.toLowerCase()}`;const y=!!(e.live||e.squad||e.stopRequested),j=e.chat?.open?"A chat is open on this ticket. Finish the talk first.":y?"The squad is working on it right now. It hands over once the step is done, or you stop it.":null,k=C.useMemo(()=>{const N=new Map;for(const $ of i.data?.ready?i.data.tickets:[])for(const A of[al($),$.createdBy,$.specApproved?.by,$.handedOver?.from,$.handedOver?.to,...($.notes??[]).map(R=>R.by)])A?.trim()&&!mu(A,o)&&N.set(A.trim().toLowerCase(),A.trim());return[...N.values()].slice(0,8)},[i.data,o]),b=l.trim()||"them",S=()=>l.trim()&&s.mutate({path:`/api/v1/tickets/${e.id}/hand-over`,body:{to:l,note:p},done:`Handed ${e.id} over to ${l.trim()}. Their squad carries on from the saved work.`},{onSuccess:()=>{d(),m(),n()}});return t.jsxs(He,{title:`Hand over ${e.id}`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(nu,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!l.trim()||!!j||s.isPending,onClick:S,children:[t.jsx(nu,{size:15})," ",s.isPending?"Pushing…":"Hand over"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad hand-over ${e.id} ${l.trim()?na(l.trim()):"Name"}${p.trim()?` --note ${Me(p.trim())}`:""}`})]}),children:[t.jsx("p",{children:"Give this ticket to a teammate. Their squad carries on where it is now."}),j&&t.jsxs("div",{className:"stuckbox",style:{marginBottom:14,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("span",{style:{flex:1},children:j}),y&&!e.chat?.open&&t.jsxs("button",{className:"btn sm",disabled:e.stopRequested||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),children:[t.jsx(is,{size:12})," ",e.stopRequested?"Stopping…":"Stop"]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"handover-to",children:"Hand it over to"}),t.jsx("input",{id:"handover-to",className:"input",autoFocus:!0,dir:xe(l),value:l,placeholder:"Their name, as their board shows it",onChange:N=>u(N.target.value),onKeyDown:N=>N.key==="Enter"&&!j&&!s.isPending&&S()}),k.length>0&&t.jsx("div",{className:"pills",style:{marginTop:8},children:k.map(N=>t.jsxs("button",{className:`pill click ${mu(N,l)?"on":""}`,onClick:()=>u(N),children:[t.jsx(am,{size:12})," ",N]},N))})]}),t.jsxs("div",{className:"field",children:[t.jsxs("label",{htmlFor:"handover-note",children:["A note for ",b," (optional)"]}),t.jsx("textarea",{id:"handover-note",className:"input",rows:2,dir:xe(p),value:p,placeholder:"Where you got to, and anything to watch out for. Every agent reads it too.",onChange:N=>f(N.target.value)})]}),t.jsx("div",{className:"lbl",children:"What happens"}),t.jsxs("ul",{className:"brief",children:[x?t.jsxs(t.Fragment,{children:[t.jsx("li",{children:"squad-kit saves the work so far and the ticket's documents, and sends them to your team's shared copy of the code."}),t.jsxs("li",{children:[b==="them"?"They become":`${b} becomes`," the owner. Their squad makes its copy of the code from that, and the Builder starts a fresh chat from the spec, the design and the code."]})]}):t.jsxs("li",{children:[b==="them"?"They become":`${b} becomes`," the owner. This is a sample board, so nothing is pushed."]}),t.jsx("li",{children:"Your squad stops working on it. You still see it on your board, with its new owner."})]}),t.jsx("div",{className:"lbl",children:"What stays on this computer"}),t.jsx("p",{className:"note",style:{fontSize:13},children:"Live progress, agent chats and screenshots. They see the documents and the code, not the chat. The Tester takes the screenshots again on their computer."})]})}function pR({t:e}){const n=la(),s=e.handedOver;return!s||!mu(s.to,n)||!_n(e,n)?null:t.jsxs("div",{className:"calm",style:{flex:"none",margin:"16px 28px 0"},children:[t.jsx("span",{className:"ring",children:t.jsx(nu,{size:16})}),t.jsxs("div",{children:[t.jsxs("b",{children:[s.from," handed this ticket to you ",St(s.at)]}),t.jsxs("span",{children:["The spec, the design, the notes and the code came with it. Live progress, agent chats and screenshots stayed on ",s.from,"'s computer, so the Builder starts a fresh chat from the spec, the design and the code, and the Tester takes the screenshots again."]})]})]})}function fR({t:e}){const n=al(e),s=e.handedOver,r=pe(),[i,o]=C.useState(!1),[l,u,d]=Ne(e.id,"take-back","");return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(am,{size:17})}),t.jsxs("div",{children:[t.jsxs("b",{children:[n," owns this ticket"]}),t.jsxs("span",{children:[s?`${s.from} handed it to ${s.to} ${St(s.at)}. `:"","Their squad works on it, on their computer. You see their work here when they push it: when they hand it over, or when its pull request opens."]})]})]}),t.jsxs("p",{className:"note",style:{marginTop:12,fontSize:13},children:["Live progress and agent chats stay on ",n,"'s computer. The spec, the design and the notes here are as ",n," last pushed them."]})]}),i?t.jsxs("div",{className:"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,dir:xe(l),value:l,onChange:p=>u(p.target.value),placeholder:`Why you take it from ${n}, for example: the name was misspelled`}),t.jsx("button",{className:"btn pri",disabled:!l.trim()||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/take-back`,body:{reason:l},done:`${e.id} is yours now. The reason stays on the ticket.`},{onSuccess:d}),children:"Take it"}),t.jsx("button",{className:"btn",onClick:()=>o(!1),children:"Cancel"}),t.jsx(re,{text:`squad take-back ${e.id} --reason ${Me(l.trim()||"…")}`})]}):t.jsxs("div",{className:"df",children:[e.stage!=="done"&&t.jsxs("button",{className:"btn quiet",title:`When ${n} cannot work on it: the name was misspelled, or they left. If ${n} is working on it, talk to them first.`,onClick:()=>o(!0),children:[n," cannot work on it? Take it"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad show ${e.id}`})]})]})}function mR(e,n,s){return s&&(!n||_n(e,n))&&!e.takenOver&&!e.deleting&&!e.archived&&e.stage!=="release"&&e.stage!=="done"&&!(e.chat?.open&&!e.chat.beside)}async function Hm(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function Vm({prompt:e,inClipboard:n}){return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",role:"status",children:n?"Copied. Paste it in a conversation in any AI tool.":"Select these words, copy them, and paste them in a conversation in any AI tool."}),t.jsx("textarea",{className:"waynote prompt-box",rows:9,readOnly:!0,value:e,"aria-label":"The prompt",onFocus:s=>s.target.select()})]})}const Cb=["What you spend there is yours: squad-kit does not count it.","squad-kit's guard and limits do not apply there.","When it comes back it keeps a label on its record. You can ask squad-kit to check the work."];function gR({t:e,onClose:n}){const s=pe(),r=pe(),[i,o]=C.useState(null),l=!i&&!!(e.live||e.squad||e.stopRequested),u=()=>s.mutate({path:`/api/v1/tickets/${e.id}/outside`},{onSuccess:async d=>o({prompt:d.prompt,inClipboard:await Hm(d.prompt)})});return t.jsx(He,{title:`Work on ${e.id} in another AI tool`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(Ki,{size:15})}),footer:i?t.jsx("button",{className:"btn pri",onClick:n,children:"Done"}):t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending||l,onClick:u,children:[t.jsx(os,{size:15})," ",s.isPending?"Getting it ready…":"Copy prompt"]}),l&&t.jsxs("button",{className:"btn",disabled:r.isPending||e.stopRequested,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping the squad"}),children:[t.jsx(is,{size:13})," ",e.stopRequested?"Stopping…":"Stop"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad outside start ${e.id}`})]}),children:i?t.jsx(Vm,{prompt:i.prompt,inClipboard:i.inClipboard}):t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"Paste the prompt in a conversation in any AI tool. It goes on from where this story is now, by this project's own structure, and this page shows it at its real step."}),t.jsx("p",{className:"note",children:l?"The squad is working on it right now. Press Stop first, or wait until it needs you.":"The squad keeps off this story until you bring it back."}),t.jsx("ul",{className:"note",children:Cb.map(d=>t.jsx("li",{children:d},d))})]})})}function xR(){const e=Ke(),[n,s]=C.useState(null),[r,i]=C.useState("");if(!(e.data?.ready&&e.data.meta.engine==="live"))return null;const o=async()=>{i("");try{const{prompt:l}=await Se("/api/v1/outside-prompt");s({prompt:l,inClipboard:await Hm(l)})}catch(l){i(l instanceof Error?l.message:String(l))}};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:()=>void o(),title:"Copy a prompt, and start this story in a conversation in any AI tool",children:[t.jsx(Ki,{size:15})," Start in another AI tool"]}),r&&t.jsx("span",{className:"note",role:"alert",children:r}),n&&t.jsxs(He,{title:"Start a story in another AI tool",onClose:()=>s(null),icon:t.jsx("span",{className:"glyph",children:t.jsx(Ki,{size:15})}),footer:t.jsx("button",{className:"btn pri",onClick:()=>s(null),children:"Done"}),children:[t.jsx(Vm,{prompt:n.prompt,inClipboard:n.inClipboard}),t.jsx("ul",{className:"note",children:Cb.map(l=>t.jsx("li",{children:l},l))})]})]})}function yR({t:e,extra:n}){const s=pe(),[r,i]=C.useState(null),[o,l]=C.useState(""),u=async()=>{l("");try{const{prompt:d}=await Se(`/api/v1/tickets/${e.id}/outside-prompt`);i({prompt:d,inClipboard:await Hm(d)})}catch(d){l(d instanceof Error?d.message:String(d))}};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(Ki,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:"In a conversation outside squad-kit"}),t.jsx("span",{children:"The squad waits. This page reads the story's files, so it shows the real step."})]})]}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:8},children:"When you are done, bring it back. It comes back at its real step: with code, you can check it and accept it here. With only a spec or a design, you approve that and the squad carries on. If nothing changed, it is as it was."}),o&&t.jsx("p",{className:"note",role:"alert",children:o}),r&&t.jsx(Vm,{prompt:r.prompt,inClipboard:r.inClipboard}),n]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/bring-back`,done:`${e.id} is back on the board.`}),children:[t.jsx(xk,{size:15})," ",s.isPending?"Looking at the work…":"Bring it back"]}),t.jsxs("button",{className:"btn",onClick:()=>void u(),children:[t.jsx(os,{size:15})," Copy prompt"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad outside back ${e.id}`})]})]})}function $b(e){return e.from?`Continued outside from ${e.from}`:"Worked outside squad-kit"}const jR="squad-kit trusts only what it ran itself. This story was worked on in a conversation outside it.";function kR({t:e}){const n=pe(),s=e.outside;if(!s)return null;const r=!s.checked&&!e.takenOver&&e.stage!=="release"&&e.stage!=="done"&&oa(e);return t.jsxs("span",{className:"outlabel",children:[t.jsx("span",{className:"prio outside",title:jR,children:$b(s)}),s.checked&&!e.takenOver?t.jsxs("span",{className:"prio outside checked",title:s.checked.noTests?"squad-kit's checks ran, but the project has no tests. The review and the proof passed.":"squad-kit's own checks, review and proof passed.",children:[t.jsx(ge,{size:11,strokeWidth:3})," ",s.checked.noTests?"Checked, no tests ran":"Checked"]}):r?t.jsx("button",{className:"btn sm tiny",disabled:n.isPending,title:"squad-kit runs its own checks, review and proof on this work. They use AI, like on any story.",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/check-outside`,done:"squad-kit is checking the work."}),children:"Check"}):null]})}function vR({t:e}){if(!e.outside&&!e.takenOver?.free)return null;const n=!!e.outside?.checked&&!e.takenOver,s=e.takenOver?.free?"In a conversation outside squad-kit":$b(e.outside);return t.jsx("span",{className:`prio outside${n?" checked":""}`,title:s,children:n?"Outside, checked":"Outside"})}function bR(e){return(e?.options??[]).map((n,s)=>{const r=n.do??(s===0?"retry":void 0);return{index:s,label:n.name,note:n.note,way:r,needs:r==="continue"||r==="skip-hooks"?"reason":r==="yourself"?"fix":null,primary:s===0}})}function wR(e){return e?.title??"The squad stopped and needs you"}const k2={cursor:"Cursor",code:"VS Code"};function Bu({t:e}){const n=pe(),r=$e({queryKey:["editors"],queryFn:()=>Se("/api/v1/editors"),staleTime:3e5}).data?.editors[0];return t.jsxs("button",{className:"btn sm",disabled:n.isPending||!e.baseCommit,title:e.baseCommit?void 0:"Nothing built yet",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/open-editor`,body:r?{editor:r}:{},done:`Opened in ${r?k2[r]:"your editor"}`}),children:[t.jsx(xs,{size:13})," Open in ",r?k2[r]:"editor"]})}function NR({t:e}){const n=$e({queryKey:["changes",e.id,e.activity.length],queryFn:()=>Se(`/api/v1/tickets/${e.id}/changes`),refetchInterval:e.live?1e4:!1}),s=n.data,r=s?.files.reduce((o,l)=>o+l.added,0)??0,i=s?.files.reduce((o,l)=>o+l.removed,0)??0;return t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"changes-head",children:[t.jsxs("div",{children:[s&&s.files.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("b",{children:[s.files.length," ",s.files.length===1?"file":"files"," changed"]})," ",t.jsxs("span",{className:"add",children:["+",r]})," ",t.jsxs("span",{className:"del",children:["−",i]})]}):t.jsx("b",{children:"Changes"}),t.jsx("p",{className:"note",children:s?.from==="branch"?"Read from its saved work. The copy was removed after the release.":"The squad builds in its own copy of the code, so your folder stays yours. These changes reach your folder after Looks right."})]}),t.jsx("span",{className:"grow"}),t.jsx(Bu,{t:e})]}),n.isLoading&&t.jsx("p",{className:"note",children:"Reading the changes…"}),n.error&&t.jsx("p",{className:"note",children:n.error.message}),s&&!s.files.length&&t.jsx("p",{className:"note",children:s.from==="none"?"Nothing built yet.":"No changes against main yet."}),s?.cut&&t.jsx("p",{className:"note",children:"This change is very large, so some files show only their name. Open it in your editor to see all of it."}),s?.files.map(o=>t.jsx(SR,{f:o},o.path)),t.jsxs("div",{className:"pills",style:{marginTop:12},children:[t.jsx(re,{text:`squad changes ${e.id} --full`}),t.jsx(re,{text:`squad open ${e.id}`})]})]})}function SR({f:e}){const n=e.patch?e.patch.split(`
628
+ `):[],[s,r]=C.useState(n.length<=300);return t.jsxs("div",{className:"conv-diff",children:[t.jsxs("button",{className:"conv-diff-head mono changes-file",onClick:()=>r(!s),children:[t.jsx("span",{className:`fstat ${e.status}`,children:e.status==="added"?"new":e.status==="deleted"?"deleted":e.status==="renamed"?"moved":"changed"}),t.jsx("span",{style:{overflowWrap:"anywhere",textAlign:"left"},children:e.path}),t.jsx("span",{className:"grow"}),e.binary?t.jsx("span",{children:"binary"}):t.jsxs("span",{children:[t.jsxs("span",{className:"add",children:["+",e.added]})," ",t.jsxs("span",{className:"del",children:["−",e.removed]})]})]}),s&&n.length>0&&t.jsx("pre",{children:n.map((i,o)=>i.startsWith("@@")?t.jsx("div",{className:"gap",children:i.replace(/^(@@[^@]*@@).*/,"$1")},o):t.jsxs("div",{className:i.startsWith("+")?"add":i.startsWith("-")?"del":"same",children:[t.jsx("span",{className:"sign",children:i.startsWith("+")?"+":i.startsWith("-")?"−":" "}),i.slice(1)||" "]},o))})]})}function Wu({ticket:e,app:n,small:s,label:r="Report a problem"}){return t.jsxs("button",{className:`btn ${s?"sm":""}`,onClick:()=>Go.open({...e?{ticket:e}:{},...n?{app:n}:{}}),children:[t.jsx(sm,{size:s?13:14})," ",r]})}function CR(){const e=v8();return e?t.jsx(TR,{ask:e,onClose:Go.close},`${e.ticket??""}${e.app?"app":""}`):null}function $R(e){return/[\\/]Downloads$/.test(e)?" in your Downloads folder":""}function TR({ask:e,onClose:n}){const{toast:s}=Le(),[r,i]=C.useState(null),[o,l]=C.useState(null),[u,d]=C.useState(""),[p,f]=C.useState(!1),[m,x]=C.useState(null),y=e.app?null:wt,j=new URLSearchParams({...y?{project:y}:{},...y&&e.ticket?{ticket:e.ticket}:{}}).toString();C.useEffect(()=>{let S=!0;return Se(`/api/v1/app/report${j?`?${j}`:""}`).then(N=>S&&i(N)).catch(N=>S&&l(N.message)),()=>{S=!1}},[j]);const k=async()=>{f(!0),l(null);try{x(await at("/api/v1/app/report","POST",{...y?{project:y}:{},...y&&e.ticket?{ticket:e.ticket}:{},...u.trim()?{note:u}:{}}))}catch(S){l(S instanceof Error?S.message:String(S))}finally{f(!1)}},b=S=>{const N=navigator.clipboard?.writeText(S);if(!N)return s("Could not copy. Select the text instead.","err");N.then(()=>s("Copied where the file is"),()=>s("Could not copy. Select the text instead.","err"))};return m?.file?t.jsxs(He,{title:"Report saved",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:n,children:[t.jsx(ge,{size:15,strokeWidth:2.5})," Done"]}),t.jsxs("button",{className:"btn",onClick:()=>b(m.file),children:[t.jsx(os,{size:14})," Copy where it is"]})]}),children:[t.jsxs("div",{className:"report-saved",role:"status",children:[t.jsx("span",{className:"report-ok",children:t.jsx(ge,{size:16,strokeWidth:2.6})}),t.jsxs("div",{children:[t.jsxs("b",{children:["Saved ",m.name,$R(m.folder)]}),t.jsx("span",{className:"mono",children:m.file})]})]}),t.jsx("p",{className:"report-send",children:"Send this file to whoever helps you with squad-kit."}),t.jsx("p",{className:"note",children:"It holds no tokens or passwords. You can open it first to see what is inside: README.txt lists every file."})]}):t.jsxs(He,{title:"Report a problem",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!r||p,onClick:()=>void k(),children:[p?t.jsx(pn,{size:15,className:"spin"}):t.jsx(sm,{size:15})," ",r?`Save ${r.name}`:"Save the report"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),r&&t.jsx(re,{text:r.command})]}),children:[t.jsx("p",{children:"squad-kit saves one file you can send to your engineer or to squad-kit support."}),r?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The file holds"}),t.jsx("ul",{className:"safe-list",children:r.holds.map(S=>t.jsxs("li",{children:[t.jsx(ge,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),S]},S))}),t.jsxs("div",{className:"report-never",children:[t.jsx("b",{children:"Never included:"})," ",r.never.replace(/^Never included:\s*/,"")]})]}):!o&&t.jsx("p",{className:"note",children:"Looking at what the file will hold…"}),t.jsxs("div",{className:"field",style:{marginTop:14},children:[t.jsx("label",{htmlFor:"report-what",children:"What happened? (optional)"}),t.jsx("textarea",{id:"report-what",className:"waynote",rows:3,dir:xe(u),value:u,onChange:S=>d(S.target.value),placeholder:"For example: it stopped after I approved the design"})]}),o&&t.jsx("p",{className:"report-err",role:"alert",children:o})]})}function ER(){return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Something wrong?"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx(Wu,{app:!0,small:!0}),t.jsx("span",{className:"note",children:"One file to send: squad-kit's log for the last 24 hours and the versions. Never your tokens or passwords."}),t.jsx(re,{text:"squad report"}),t.jsx(re,{text:"squad logs"})]})]})}function Km({title:e,what:n,safe:s=[],ways:r,report:i,hint:o,calm:l,children:u}){return t.jsxs("div",{className:`drafterr errcard${l?" calm":""}`,role:"alert",children:[t.jsx("b",{className:"errcard-title",children:e}),t.jsx("div",{className:"errcard-what",children:n}),s.length>0&&t.jsx("ul",{className:"safe-list",children:s.map(d=>t.jsxs("li",{children:[t.jsx(ge,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),d]},d))}),t.jsx("div",{className:"errcard-lbl",children:"What you can do"}),t.jsxs("div",{className:"drafterr-ways",children:[r.map(d=>t.jsxs("button",{className:`btn ${d.primary?"pri":""}`,disabled:d.disabled,title:d.title,onClick:d.onClick,children:[d.icon,d.label]},d.label)),i!==!1&&t.jsx(Wu,{...i??{}})]}),o&&t.jsx("div",{className:"errcard-hint",children:o}),u]})}function AR({t:e,extra:n}){const s=pe(),[r,i,o]=Ne(e.id,"stuck-open",null),[l,u,d]=Ne(e.id,"stuck-text",""),p=bR(e.stuck),f=(b,S,N)=>s.mutate({path:`/api/v1/tickets/${e.id}/decide`,body:{choice:b,...S},done:N},{onSuccess:()=>{o(),d()}}),m=p.find(b=>b.way==="retry"),x=r==="reason"||r==="fix"?p.find(b=>b.needs===r):void 0,y=r==="note"&&l.trim()?l.trim():"",j=p.map(b=>({label:b.label,title:b.note,primary:b.primary,disabled:s.isPending,icon:b.way==="retry"?t.jsx(Kr,{size:14}):b.way==="yourself"?t.jsx(wo,{size:14}):void 0,onClick:()=>{if(b.needs){i(r===b.needs?null:b.needs),u("");return}f(b.index,b.way==="retry"&&y?{note:y}:{},b.way==="retry"?"Trying again. The squad carries on.":"Decided. The squad carries on.")}})),k=x?`squad decide ${e.id} ${x.index+1}${x.needs==="reason"?` --reason ${Me(l.trim()||"…")}`:""}`:`squad decide ${e.id}${m&&y?` ${m.index+1} --note ${Me(y)}`:""}`;return t.jsxs("div",{className:"db",children:[t.jsx(Km,{title:wR(e.stuck),calm:e.stuck?.kind==="no-tests"||e.stuck?.gate==="cap",what:e.stuck?.points?.length?t.jsxs(t.Fragment,{children:[t.jsx(D,{as:"div",text:e.stuck.question}),t.jsx("ul",{className:"errcard-points",children:e.stuck.points.map(b=>t.jsx(D,{as:"li",text:b},b))})]}):t.jsx(D,{as:"div",text:e.stuck?.question??""}),safe:e.stuck?.safe??["Nothing was lost: the work so far is kept."],ways:j,report:{ticket:e.id},hint:t.jsxs(t.Fragment,{children:[m&&r!=="note"&&t.jsx("button",{className:"linkbtn",onClick:()=>i("note"),children:"Add a note for the squad first"}),e.stuck?.detail?" Engineers: the exact error is in the Developer tab.":""]})}),r==="note"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"A note for the squad (optional)"}),t.jsx("textarea",{className:"waynote",rows:2,dir:xe(l),value:l,onChange:b=>u(b.target.value),placeholder:"For example: the test server needs the VPN, it is on now"}),t.jsxs("p",{className:"note",style:{fontSize:12.5},children:["The squad reads it first when you press ",m?.label??"Try again","."]})]}),r==="reason"&&x&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:x.way==="skip-hooks"?"Why save it without the check?":"Why continue anyway?"}),t.jsx("textarea",{className:"waynote",rows:2,dir:xe(l),value:l,onChange:b=>u(b.target.value),placeholder:x.way==="skip-hooks"?"For example: the check needs a licence this laptop does not have":"For example: the failing test is broken on main too, fixed in SK-160"}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"Only you can do this. Your reason shows on the ticket, the pull request and the release notes."}),t.jsx("div",{className:"errcard-confirm",children:t.jsxs("button",{className:"btn pri",disabled:!l.trim()||s.isPending,onClick:()=>f(x.index,{reason:l},"Decided. The squad carries on."),children:[t.jsx(ge,{size:15,strokeWidth:2.5})," ",x.label]})})]}),r==="fix"&&x&&t.jsxs("div",{className:"stuckbox",style:{marginTop:12},children:[t.jsxs("p",{style:{margin:"0 0 8px"},children:["Open the ticket's copy, fix it, and save. Then press ",t.jsx("b",{children:"I fixed it"}),": the checks, review and proof run again."]}),t.jsxs("div",{className:"errcard-confirm",children:[t.jsx(Bu,{t:e}),t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>f(x.index,{},"OK. The checks run again on your fix."),children:[t.jsx(ge,{size:15,strokeWidth:2.5})," I fixed it, check again"]})]})]}),t.jsx("div",{className:"errcard-cmd",children:t.jsx(re,{text:k})}),n]})}function PR({t:e}){const{toast:n}=Le();if(!e.stuck||e.waiting?.kind!=="stuck")return null;const s=e.stuck.detail??e.stuck.question,r=()=>{const i=navigator.clipboard?.writeText(s);if(!i)return n("Could not copy. Select the text instead.","err");i.then(()=>n("Copied the exact error"),()=>n("Could not copy. Select the text instead.","err"))};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The exact error"}),t.jsx("pre",{className:"exact-err",children:s}),t.jsxs("div",{className:"pills",style:{marginTop:8},children:[t.jsxs("button",{className:"btn sm",onClick:r,children:[t.jsx(os,{size:13})," Copy"]}),t.jsx(Wu,{ticket:e.id,small:!0}),t.jsx(re,{text:"squad logs --tail"})]})]})}const v2=10*1024*1024;function ol(e){return new Promise((n,s)=>{const r=new FileReader;r.onload=()=>{const i=String(r.result);n({name:e.name,size:e.size,data:i.slice(i.indexOf(",")+1),...e.type.startsWith("image/")?{preview:i}:{}})},r.onerror=()=>s(new Error(`Could not read ${e.name}`)),r.readAsDataURL(e)})}function RR(e){const n=/\.(png|jpe?g|gif|webp)$/i.exec(e.name)?.[1]?.toLowerCase();return n?{preview:`data:image/${n==="jpg"?"jpeg":n};base64,${e.data}`}:{}}const Et="new-ticket";function b2(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Tb({onClose:e,onCreated:n}){const s=pe(),{toast:r}=Le(),[i,o]=Ne(Et,"mode","write"),[l,u]=Ne(Et,"pasted",""),[d,p]=C.useState(null),[f,m]=C.useState(null),x=d?.status==="working",[y,j]=C.useState(null),[k,b]=Ne(Et,"title",""),[S,N]=Ne(Et,"ask",""),[$,A]=Ne(Et,"kind","feature"),[R,E]=Ne(Et,"priority","normal"),[M,F]=Ne(Et,"track","full"),[W,I]=C.useState(!1),[q,L]=C.useState(null),[U,_]=Ne(Et,"criteria",[]),[G,le]=Ne(Et,"rules",[]),[V,Y]=Ne(Et,"edge-cases",[]),[te,P]=Ne(Et,"what",""),[B,J]=Ne(Et,"steps",[]),[z,ye]=Ne(Et,"expected",""),[fe,ve]=Ne(Et,"where",""),[Fe,Ie]=Ne(Et,"severity","annoying"),Re=$==="bug",[Je,Ot]=C.useState(()=>j2(Et,"create-key",b2)),$n=C.useRef(!1),[gt,Zt]=C.useState([]),Tn=async se=>{const Ze=[...se],st=Ze.find(ct=>ct.size>v2);st&&r(`${st.name} is larger than 10 MB.`,"err");const xt=await Promise.all(Ze.filter(ct=>ct.size<=v2).map(ol)).catch(ct=>(r(ct.message,"err"),[]));Zt(ct=>[...ct,...xt].slice(0,10))},En=gt.map(({name:se,data:Ze})=>({name:se,data:Ze})),Vn=se=>{b(se.title),N(se.ask),se.kind==="bug"&&P(se.ask),A(se.kind),E(se.priority),se.track&&(F(se.track),L(se.track)),_(se.criteria),le(se.rules),Y(se.edgeCases),j(se.gaps),o("write")};C.useEffect(()=>{let se=!0;return Se("/api/v1/tickets/draft/current").then(async({draft:Ze})=>{if(!(!se||!Ze)&&(u(Ze.text),o("paste"),p(Ze),Ze.files.length)){const st=await Se(`/api/v1/tickets/draft/${Ze.id}/files`).catch(()=>({files:[]}));se&&Zt(st.files.map((xt,ct)=>({...xt,size:Ze.files[ct]?.size??0,...RR(xt)})))}}).catch(()=>{}),()=>{se=!1}},[]);const Pt=$e({queryKey:["ticket-draft",d?.id],queryFn:()=>Se(`/api/v1/tickets/draft/${d.id}`),enabled:x,refetchInterval:1e3,retry:!1});C.useEffect(()=>{Pt.data&&d?.status==="working"&&Pt.data.id===d.id&&p(Pt.data)},[Pt.data]),C.useEffect(()=>{Pt.isError&&x&&p(se=>se&&{...se,status:"failed",error:"squad-kit lost this draft, maybe because it restarted."})},[Pt.isError]);const mn=C.useRef(null);C.useEffect(()=>{d?.status==="done"&&d.draft&&mn.current!==d.id&&(mn.current=d.id,Vn(d.draft))},[d]);const Ct=async()=>{m(null);try{p(await at("/api/v1/tickets/draft","POST",{text:l,files:En}))}catch(se){m(se instanceof Error?se.message:String(se))}},An=async()=>{if(d)try{p(await at(`/api/v1/tickets/draft/${d.id}/cancel`,"POST"))}catch{p({...d,status:"cancelled"})}},Pn=()=>{d&&at(`/api/v1/tickets/draft/${d.id}/dismiss`,"POST").catch(()=>{}),p(null)},Hs=()=>{Pn(),m(null),S.trim()||N(l.trim()),te.trim()||P(l.trim()),o("write")},ls=()=>{Pn(),j(null),L(null);for(const se of[b,N,P,ye,ve])se("");for(const se of[_,le,Y,J])se([]);o("paste")},Ge=()=>{ls(),u(""),Zt([]),o("write"),A("feature"),E("normal"),F("full"),Ie("annoying"),y2(wt,Et),Ot(j2(Et,"create-key",b2))},ee=!!(l||k||S||te||z||fe||U.length||G.length||V.length||B.length),ue=B.filter(se=>se.trim()),Te=[te.trim()&&`What happens:
629
+ ${te.trim()}`,ue.length&&`Steps to see it:
630
+ ${ue.map((se,Ze)=>`${Ze+1}. ${se.trim()}`).join(`
631
+ `)}`,z.trim()&&`What should happen:
632
+ ${z.trim()}`,fe.trim()&&`Where: ${fe.trim()}`].filter(Boolean).join(`
633
+
634
+ `),Oe=Re?{title:k,ask:Te,kind:$,severity:Fe,priority:Fe==="stops-work"?"high":Fe==="small"?"low":"normal",track:M,files:En,talkFirst:W&&M==="full",key:Je}:{title:k,ask:S,kind:$,track:M,priority:R,criteria:U,rules:G,edgeCases:V,files:En,talkFirst:W&&M==="full",key:Je},We=()=>s.mutate({path:"/api/v1/tickets",body:Oe,after:()=>{Pn(),y2(wt,Et)},done:se=>$n.current?`${se.id} is on the board.`:null},{onSuccess:se=>{n(se),e()}}),kt=()=>{s.isPending&&($n.current=!0,r("Your ticket is still being made. Closing this does not stop it: it comes onto the board in a moment.")),e()},Rn=!!f||d?.status==="failed"||d?.status==="cancelled",tn=i==="paste"?`squad new --from ${Me(l.trim().split(`
635
+ `)[0]?.slice(0,40)||"your message")}`:[`squad new ${Me(k.trim()||"Your title")}`,Re?`--bug --severity ${Fe}`:"",Re&&te.trim()?`--ask ${Me(te.trim())}`:"",M==="express"?"--express":"",W&&M==="full"?"--talk":"",...Re?[]:U.filter(se=>se.trim()).map(se=>`--criteria ${Me(se)}`),...Re?[]:G.filter(se=>se.trim()).map(se=>`--rule ${Me(se)}`),...Re?[]:V.filter(se=>se.trim()).map(se=>`--edge ${Me(se)}`),...gt.map(se=>`--attach ${Me(se.name)}`)].filter(Boolean).join(" ");return t.jsxs(He,{title:"New ticket",wide:!0,onClose:kt,losing:gt.length&&!s.isPending?gt.length===1?"the attached file":`the ${gt.length} attached files`:null,icon:t.jsx("span",{className:"glyph",children:t.jsx(Nt,{size:15})}),footer:t.jsxs(t.Fragment,{children:[i==="paste"?Rn?null:t.jsxs("button",{className:"btn pri",disabled:!l.trim()&&!gt.length||x,onClick:()=>void Ct(),children:[x?t.jsx(pn,{size:15,className:"spin"}):t.jsx(Oc,{size:15})," ",x?"Filling in…":"Fill in the ticket"]}):t.jsxs("button",{className:"btn pri",disabled:!k.trim()||s.isPending,onClick:We,children:[t.jsx(Nt,{size:15})," Create ticket"]}),t.jsx("button",{className:"btn",onClick:x?()=>void An():kt,children:s.isPending?"Close":"Cancel"}),ee&&!x&&t.jsx(Ek,{onClear:Ge}),!ee&&!x&&t.jsx(xR,{}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:tn})]}),children:[t.jsxs("div",{className:"seg",style:{marginBottom:14,width:"fit-content"},children:[t.jsx("button",{className:i==="write"?"on":"",disabled:x,title:x?"Press Cancel first to write it yourself":void 0,onClick:()=>o("write"),children:"Write it"}),t.jsxs("button",{className:i==="paste"?"on":"",onClick:()=>o("paste"),children:[t.jsx(Oc,{size:13,style:{verticalAlign:"-2px",marginRight:5}}),"From an idea or message"]})]}),i==="paste"?t.jsxs(t.Fragment,{children:[!x&&t.jsx("p",{children:"Paste an idea, a WhatsApp message or one line of business. Add screenshots if you have them. The Analyst fills in the ticket, and you check every field before it is created."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-paste",children:"The idea or message"}),t.jsx("textarea",{id:"nt-paste",className:"textarea",style:{minHeight:x?70:150},autoFocus:!0,readOnly:x,dir:xe(l),value:l,onChange:se=>u(se.target.value),onPaste:se=>{se.clipboardData.files.length&&(se.preventDefault(),Tn(se.clipboardData.files))},placeholder:"For example: the manager says clerks should not book more than 3 appointments a day for the same person"})]}),x&&d?t.jsxs(t.Fragment,{children:[gt.length>0&&t.jsxs("p",{className:"note",style:{margin:"-6px 0 12px"},children:["With ",gt.map(se=>se.name).join(", ")]}),t.jsx(zR,{job:d})]}):t.jsx(Cp,{files:gt,onAdd:Tn,onRemove:se=>Zt(Ze=>Ze.filter((st,xt)=>xt!==se))}),Rn&&t.jsx(LR,{error:f??(d?.status==="failed"?d.error??"Something went wrong.":null),onRetry:()=>void Ct(),onWrite:Hs})]}):t.jsxs(t.Fragment,{children:[y?t.jsxs("div",{className:"drafted",children:[t.jsxs("b",{children:[t.jsx(Oc,{size:13})," The Analyst filled this in from your message."]})," Check it and change anything."," ",t.jsx("button",{className:"linkbtn",onClick:ls,children:"Discard this draft"}),y.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{marginTop:6},children:"Still unclear, so the Analyst will ask you after you create it:"}),t.jsx("ul",{children:y.map((se,Ze)=>t.jsx(D,{as:"li",text:se},Ze))})]})]}):t.jsx("p",{children:Re?"Say what goes wrong and how to see it. The squad finds the cause and fixes it.":"Write it in plain words. Add what you already know; the Analyst asks you about the rest."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Kind"}),t.jsx("div",{className:"sevs",children:["feature","bug"].map(se=>t.jsxs("button",{className:`choice ${$===se?"on":""}`,onClick:()=>A(se),children:[t.jsx("span",{className:"rd"}),se==="feature"?"New feature":"Bug"]},se))})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-title",children:"Title"}),t.jsx("input",{id:"nt-title",className:"input",autoFocus:!0,dir:xe(k),value:k,onChange:se=>b(se.target.value),placeholder:Re?"For example: A price written as 1,500 is refused":"For example: Show hearing time in local time"})]}),Re?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-what",children:"What happens"}),t.jsx("textarea",{id:"nt-what",className:"textarea",dir:xe(te),value:te,onChange:se=>P(se.target.value),placeholder:"For example: the form says the price is not valid."})]}),t.jsx($c,{label:"Steps to see it",hint:"One step per line, for example: Open Services and add a service.",items:B,onChange:J,add:"Add a step"}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-expected",children:"What should happen"}),t.jsx("textarea",{id:"nt-expected",className:"textarea",dir:xe(z),value:z,onChange:se=>ye(se.target.value),placeholder:"For example: the price is saved as 1,500 SAR."})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-where",children:"Where"}),t.jsx("input",{id:"nt-where",className:"input",dir:xe(fe),value:fe,onChange:se=>ve(se.target.value),placeholder:"The page or link, for example: Setup, Services"})]}),t.jsx(Cp,{files:gt,onAdd:Tn,onRemove:se=>Zt(Ze=>Ze.filter((st,xt)=>xt!==se))}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"How bad is it?"}),t.jsx("div",{className:"sevs",children:Eb.map(se=>t.jsxs("button",{className:`choice ${Fe===se.value?"on":""}`,onClick:()=>Ie(se.value),children:[t.jsx("span",{className:"rd"}),se.label]},se.value))})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-ask",children:"What do you want?"}),t.jsx("textarea",{id:"nt-ask",className:"textarea",dir:xe(S),value:S,onChange:se=>N(se.target.value),placeholder:"Who needs it, and why. One or two sentences is enough."})]}),t.jsx($c,{label:"Acceptance criteria",hint:"Each one is something you can check, for example: The clerk sees the time in their own city.",items:U,onChange:_,add:"Add a criterion"}),t.jsx($c,{label:"Business rules",hint:"Limits and who may do what, for example: Only a team lead can reassign a case.",items:G,onChange:le,add:"Add a rule"}),t.jsx($c,{label:"Edge cases",hint:"Unusual cases to handle, for example: The person has no cases yet.",items:V,onChange:Y,add:"Add an edge case"}),t.jsx(Cp,{files:gt,onAdd:Tn,onRemove:se=>Zt(Ze=>Ze.filter((st,xt)=>xt!==se))}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Priority"}),t.jsx("div",{className:"sevs",children:["high","normal","low"].map(se=>t.jsxs("button",{className:`choice ${R===se?"on":""}`,onClick:()=>E(se),children:[t.jsx("span",{className:"rd"}),se==="high"?"High":se==="normal"?"Normal":"Low"]},se))})]})]}),t.jsxs("div",{className:"field",children:[t.jsxs("label",{children:["Track",q&&t.jsxs("span",{className:"note",style:{marginLeft:8,fontWeight:400},children:["The Analyst suggests ",q==="express"?"Express":"Full"]})]}),t.jsx("div",{className:"tracks",children:MR.map(se=>t.jsxs("button",{className:`opt2 ${M===se.id?"pick":""}`,onClick:()=>F(se.id),children:[t.jsxs("b",{children:[se.name,M===se.id&&t.jsxs("span",{children:[t.jsx(ge,{size:13,strokeWidth:2.5})," Chosen"]})]}),se.note]},se.id))})]}),M==="full"&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:W,onChange:se=>I(se.target.checked)}),t.jsxs("span",{children:[t.jsx("b",{children:"Talk it through first."})," The Analyst opens a chat instead of sending questions. The spec is written from your talk when you say so."]})]})]})]})}const IR=60;function FR(e){const[n,s]=C.useState(Date.now());return C.useEffect(()=>{const r=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(r)},[e]),n}function zR({job:e}){const n=FR(!0),s=Math.max(0,Math.floor((n-Date.parse(e.startedAt))/1e3)),i=["read","look","write"].indexOf(e.step),o=d=>d<i?"done":d===i?"now":"todo",l=e.looked.slice(-3),u=e.looked.length-l.length;return t.jsxs("div",{className:"drafting",role:"status","aria-live":"polite",children:[t.jsxs("div",{className:"drafting-head",children:[t.jsx("b",{children:"The Analyst is filling in your ticket"}),t.jsx("span",{className:"grow"}),t.jsxs("span",{className:"mono drafting-clock","aria-label":`${s} seconds so far`,children:[Math.floor(s/60),":",String(s%60).padStart(2,"0")]})]}),t.jsx(Sp,{state:o(0),children:"Read your message"}),t.jsxs(Sp,{state:o(1),children:["Looking at the project",l.length>0&&t.jsxs("span",{className:"note",children:[": ",l.join(", "),u>0?` and ${u} more`:""]})]}),t.jsx(Sp,{state:o(2),children:"Writing the ticket for you to check"}),t.jsxs("p",{className:"note",children:[s>2*IR?"This one is taking longer than usual. You can wait, or press Cancel.":"Usually under a minute."," You can close this window: the draft waits for you under New ticket."]})]})}function Sp({state:e,children:n}){return t.jsxs("div",{className:`dstep ${e}`,children:[t.jsx("span",{className:"dot","aria-hidden":"true",children:e==="done"?t.jsx(ge,{size:12,strokeWidth:3}):e==="now"?t.jsx(pn,{size:12,className:"spin"}):null}),t.jsxs("span",{children:[n,t.jsx("span",{className:"sr-only",children:e==="done"?" (done)":e==="now"?" (now)":""})]})]})}function LR({error:e,onRetry:n,onWrite:s}){return e?t.jsx(Km,{title:"The Analyst could not finish",what:e,safe:["Your text and files are kept.","No ticket was made yet."],ways:[{label:"Try again",primary:!0,icon:t.jsx(Kr,{size:14}),onClick:n},{label:"Write it myself with what I typed",icon:t.jsx(wo,{size:14}),onClick:s}]}):t.jsxs("div",{className:"drafterr calm",role:"status",children:[t.jsx("b",{children:"You stopped the Analyst"}),t.jsx("div",{children:"Nothing was saved. Your text is kept."}),t.jsxs("div",{className:"drafterr-ways",children:[t.jsxs("button",{className:"btn pri",onClick:n,children:[t.jsx(Kr,{size:14})," Try again"]}),t.jsxs("button",{className:"btn",onClick:s,children:[t.jsx(wo,{size:14})," Write it myself with what I typed"]})]})]})}const MR=[{id:"full",name:"Full",note:"Every step. The Analyst asks questions and you approve the plan."},{id:"express",name:"Express",note:"For a typo or a small urgent fix. No questions, the plan is approved on its own. Build, checks, review and your Looks right still run."}];function $c({label:e,hint:n,items:s,onChange:r,add:i}){const o=(l,u)=>r(s.map((d,p)=>p===l?u:d));return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:e}),s.length===0&&t.jsx("p",{className:"note",style:{margin:"0 0 6px"},children:n}),s.map((l,u)=>t.jsxs("div",{className:"listrow",children:[t.jsx("span",{className:"mono note",children:u+1}),t.jsx("input",{className:"input",dir:xe(l),value:l,autoFocus:l===""&&u===s.length-1,onChange:d=>o(u,d.target.value),onKeyDown:d=>{d.key==="Enter"&&u===s.length-1&&l.trim()&&r([...s,""])},"aria-label":`${e} ${u+1}`}),t.jsx("button",{className:"iconbtn",onClick:()=>r(s.filter((d,p)=>p!==u)),"aria-label":`Remove ${e.toLowerCase()} ${u+1}`,children:t.jsx(Qe,{size:14})})]},u)),t.jsxs("button",{className:"btn sm",onClick:()=>r([...s,""]),children:[t.jsx(Nt,{size:13})," ",i]})]})}const qR=/\.(ogg|opus|oga|m4a|mp3|wav|aac|amr|flac|weba|mp4|mov|m4v|webm)$/i;function Cp({files:e,onAdd:n,onRemove:s}){const[r,i]=C.useState(!1),o=e.some(u=>qR.test(u.name)),l=$e({queryKey:["speech"],queryFn:()=>Se("/api/v1/speech"),enabled:o});return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Files"}),t.jsxs("label",{className:`dropzone ${r?"over":""}`,onDragOver:u=>{u.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:u=>{u.preventDefault(),i(!1),u.dataTransfer.files.length&&n(u.dataTransfer.files)},onPaste:u=>u.clipboardData.files.length&&n(u.clipboardData.files),children:[t.jsx(su,{size:15})," Drop screenshots, documents, voice or video notes here, or click to pick",t.jsx("input",{type:"file",multiple:!0,hidden:!0,onChange:u=>{u.target.files?.length&&n(u.target.files),u.target.value=""}})]}),e.length>0&&t.jsx("div",{className:"picked",children:e.map((u,d)=>t.jsxs("span",{className:"pickedfile",children:[u.preview?t.jsx("img",{src:u.preview,alt:""}):t.jsx(su,{size:13}),t.jsx("span",{className:"mono",children:u.name}),t.jsx("span",{className:"note",children:u.size<1024*1024?`${Math.max(1,Math.round(u.size/1024))} KB`:`${(u.size/1024/1024).toFixed(1)} MB`}),t.jsx("button",{className:"iconbtn",onClick:()=>s(d),"aria-label":`Remove ${u.name}`,children:t.jsx(Qe,{size:13})})]},`${u.name}-${d}`))}),o&&l.data&&t.jsx("p",{className:"note",style:{marginTop:6},children:l.data.hasKey?l.data.video===!1?"squad-kit writes out voice notes with Munsit, so every agent knows what was said. Video notes need a Mac: on this computer they stay attached, unheard.":"squad-kit writes out voice and video notes with Munsit, and takes pictures of the screen in videos, so every agent knows what was said.":"Add a Munsit key in Settings so the squad can listen to voice and video notes. Without it they stay attached, unheard."})]})}function OR({onClose:e,onCreated:n}){const s=pe(),[r,i]=C.useState("AB#"),o=r.replace(/\D/g,"").length===0||s.isPending,l=()=>{o||s.mutate({path:"/api/v1/pull",body:{ref:r}},{onSuccess:u=>{n(u),e()}})};return t.jsxs(He,{title:"Pull from Azure DevOps",onClose:e,icon:t.jsx("span",{className:"glyph",children:t.jsx(ks,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:o,onClick:l,children:[t.jsx(ks,{size:15})," Pull ticket"]}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad pull ${r.trim()?na(r.trim()):"AB#4133"}`})]}),children:[t.jsx("p",{children:"Bring a work item in as a ticket, with its description and attachments."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"pull-ref",children:"Work item"}),t.jsx("input",{id:"pull-ref",className:"input mono",autoFocus:!0,value:r,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&l()})]})]})}const Eb=[{value:"stops-work",label:"Stops work"},{value:"annoying",label:"Annoying"},{value:"small",label:"Small"}];function Ym({onClose:e,foundIn:n}){const s=pe(),[r,i,o]=Ne("report-bug","what",""),[l,u,d]=Ne("report-bug","how",""),[p,f,m]=Ne("report-bug","expected",""),[x,y]=C.useState("annoying"),j=()=>{o(),d(),m()},k=()=>s.mutate({path:"/api/v1/bugs",body:{what:r,how:l,expected:p,severity:x,foundIn:n},done:"Bug reported. Triage is sorting it."},{onSuccess:()=>{j(),e()}});return t.jsxs(He,{title:"Report a bug",onClose:e,icon:t.jsx("span",{className:"glyph",style:{background:"var(--bug-soft)",color:"var(--bug)"},children:t.jsx(Os,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!r.trim()||s.isPending,onClick:k,children:[t.jsx(Os,{size:15})," Report bug"]}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),(r||l||p)&&t.jsx(Ek,{onClear:j}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad bug ${Me(r.trim()||"What happened")}${n?` --in ${n}`:""}`})]}),children:[t.jsxs("p",{children:["It becomes a ticket linked to ",n??"the latest release",", and goes around the same loop. The Tester adds a check so it can't come back."]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-what",children:"What happened?"}),t.jsx("input",{id:"bug-what",className:"input",autoFocus:!0,dir:xe(r),value:r,onChange:b=>i(b.target.value),placeholder:"For example: Table text is hard to read in dark mode"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-how",children:"How can we see it?"}),t.jsx("input",{id:"bug-how",className:"input",dir:xe(l),value:l,onChange:b=>u(b.target.value),placeholder:"The steps, in a line"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-exp",children:"What did you expect?"}),t.jsx("input",{id:"bug-exp",className:"input",dir:xe(p),value:p,onChange:b=>f(b.target.value)})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"How bad is it?"}),t.jsx("div",{className:"sevs",children:Eb.map(b=>t.jsxs("button",{className:`choice ${x===b.value?"on":""}`,onClick:()=>y(b.value),children:[t.jsx("span",{className:"rd"}),b.label]},b.value))})]})]})}function _R({release:e,demo:n,onClose:s}){const{toast:r}=Le(),i=()=>void navigator.clipboard?.writeText(e.whatsappDraft??"").then(()=>r("Message copied. Send it from WhatsApp.")),o=[e.addons.changelog&&"Changelog updated",e.addons.tag&&`Marked the code as ${e.version}`,e.addons.pipeline&&"After-release step started"].filter(Boolean);return t.jsxs(He,{title:e.unpushed?.length?`${e.version} is made, but not sent yet`:`${e.version} is released`,onClose:s,icon:t.jsx("span",{className:"glyph",children:t.jsx(io,{size:15})}),footer:t.jsxs(t.Fragment,{children:[e.addons.whatsapp&&t.jsxs("button",{className:"btn pri",onClick:i,children:[t.jsx(os,{size:15})," Copy message"]}),t.jsx("button",{className:"btn",onClick:s,children:"Done"})]}),children:[t.jsxs("div",{className:"donelist",children:[e.unpushed?.length?t.jsxs("div",{style:{color:"var(--you-ink)"},children:[t.jsx("span",{style:{width:16,textAlign:"center",fontWeight:800},children:"!"})," It did not reach your team's shared copy of the code, so its tickets stay open. Press Send again on the release once it can."]}):t.jsxs("div",{children:[t.jsx(ge,{size:16})," ",e.tickets.length," tickets released"]}),e.log?e.log.map(l=>t.jsxs("div",{style:l.ok?void 0:{color:"var(--you-ink)"},...De(l.text),children:[l.ok?t.jsx(ge,{size:16}):t.jsx("span",{style:{width:16,textAlign:"center",fontWeight:800},children:"!"})," ",t.jsx(D,{text:l.text})]},l.text)):o.map(l=>t.jsxs("div",{children:[t.jsx(ge,{size:16})," ",l]},l))]}),n&&!e.log&&t.jsx("p",{className:"note",style:{marginBottom:12},children:"Demo board: these release steps are shown, not run."}),e.addons.whatsapp&&e.whatsappDraft&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",style:{marginTop:4},children:"A WhatsApp note for your manager. Copy it and send it yourself."}),t.jsx(um,{className:"wa",text:e.whatsappDraft})]})]})}function Ds(e){return e.stage==="release"||e.stage==="done"}function Uu(e){return Ds(e)||!!e.specApproved||["implement","test","review"].includes(e.stage)}function DR(e){return e.part==="story"?"The story":e.index===void 0?"New done when":`Done when ${e.index+1}`}function Nf(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`:String(e[0]??"")}function w2({parts:e}){return t.jsx("div",{className:"changeparts",children:e.map((n,s)=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:DR(n)}),n.before?t.jsx(D,{as:"div",className:"chold",text:n.before}):t.jsx("div",{className:"chold empty",children:t.jsx("i",{children:"new"})}),n.after?t.jsx(D,{as:"div",className:"chnew",text:n.after}):t.jsx("div",{className:"chnew",children:t.jsx("i",{children:"removed"})})]},s))})}const N2={same:"Stays",changed:"Redone",new:"New"};function BR({c:e}){const n=e.design,s=n.before.filter(i=>!n.steps.some(o=>o.title===i)),r=n.steps.flatMap((i,o)=>i.change==="same"?[o+1]:[]);return t.jsxs("div",{className:"changeparts",children:[r.length>0&&t.jsxs("div",{className:"chrow",children:[t.jsxs("div",{className:"chlabel",children:[r.length===1?"Step":"Steps"," ",Nf(r)]}),t.jsx("div",{children:t.jsx("span",{className:"pill wait",children:N2.same})}),t.jsx("div",{className:"chnew note",children:"Built already, as they are."})]}),n.steps.map((i,o)=>i.change==="same"?null:t.jsxs("div",{className:"chrow",children:[t.jsxs("div",{className:"chlabel",children:["Step ",o+1]}),t.jsx("div",{children:t.jsx("span",{className:"pill you",children:N2[i.change]})}),t.jsx(D,{as:"div",className:"chnew",text:i.title})]},o)),s.map(i=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:"Dropped"}),t.jsx("div",{}),t.jsx(D,{as:"div",className:"chold",text:i})]},i))]})}function WR(e,n){const s=!!e.sessions?.build;return n.size==="big"?s?"Approve, and the Builder pauses after its current step. The Architect updates the design and you approve that too. Then the Builder redoes only the steps the change touches.":e.steps?"Approve, and the spec says it now. The Architect updates the design, and you approve it as usual.":"Approve, and the spec says it now. The Architect designs from the new spec.":s?"Approve, and the spec says it now. The Builder gets it at the end of its current step; the work does not stop.":"Approve, and the spec says it now. The Builder builds from the new spec."}function UR({t:e}){const n=pe(),[s,r]=C.useState(!1),[i,o]=C.useState(!1),[l,u,d]=Ne(e.id,"change-reason",""),p=si(e);if(!p)return null;const f=p.status==="approved"||p.status==="designing",m=p.status==="writing"||p.status==="designing"||p.status==="building",x=(e.steps??[]).flatMap((k,b)=>k.status==="done"?[]:[b+1]),y={writing:`Change ${p.id}: the Analyst is writing it into the spec`,failed:`Change ${p.id}: the Analyst could not write it`,proposed:`Change ${p.id} to the spec`,approved:`Change ${p.id} is approved`,designing:`Change ${p.id}: the Architect is updating the design`,"design-ready":`The design update for change ${p.id}`,building:p.size==="big"?`Change ${p.id}: the Builder is redoing ${x.length===1?"step":"steps"} ${Nf(x)}`:`Change ${p.id}: the Builder is making it`,done:"",declined:""}[p.status],j=(k,b,S)=>n.mutate({path:`/api/v1/tickets/${e.id}/spec-change/${k}`,body:S,done:b},{onSuccess:()=>{r(!1),o(!1),d()}});return t.jsx("div",{className:"outdated","aria-label":"Change to the spec",children:t.jsxs("div",{className:"outdated-item changecard",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:m?t.jsx(pn,{size:15,className:"spin"}):p.status==="failed"?t.jsx(kr,{size:15}):t.jsx(vs,{size:15})}),t.jsx("b",{children:y}),p.size&&t.jsx("span",{className:`pill ${p.size==="big"?"you":"wait"}`,children:p.size==="big"?"Big change":"Small change"})]}),t.jsxs("div",{className:"changebody",children:[t.jsx(D,{as:"p",text:p.summary??`“${p.ask}”`}),p.status==="writing"&&t.jsx("p",{className:"note",children:"The work goes on meanwhile. Nothing changes until you approve it."}),p.status==="failed"&&t.jsx(D,{as:"p",className:"note",text:p.error??""}),p.why&&(p.status==="proposed"||p.status==="approved")&&t.jsx(D,{as:"p",className:"note",text:p.why}),p.status==="proposed"&&p.parts&&t.jsx(w2,{parts:p.parts}),p.status==="proposed"&&t.jsx("p",{className:"note",children:WR(e,p)}),p.status==="approved"&&t.jsx("p",{className:"note",children:p.size==="big"?"The Builder finishes its current step, then pauses while the Architect updates the design.":"It reaches the Builder at the end of its current step. The work goes on."}),p.status==="designing"&&t.jsx("p",{className:"note",children:"The Builder paused after its step. The design update comes to you next."}),p.status==="design-ready"&&p.design&&t.jsxs(t.Fragment,{children:[p.design.summary&&t.jsx(D,{as:"p",text:p.design.summary}),t.jsx(BR,{c:p}),p.parts&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",children:"And the spec, as you approved it:"}),t.jsx(w2,{parts:p.parts})]}),t.jsxs("p",{className:"note",children:["Approve, and the Builder redoes only ",(()=>{const k=p.design.steps.flatMap((b,S)=>b.change==="same"?[]:[S+1]);return k.length?`${k.length===1?"step":"steps"} ${Nf(k)}`:"what changed"})(),". Decline, and the spec stays as it was; the Builder carries on."]})]})]}),i?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(l),value:l,onChange:k=>u(k.target.value),placeholder:"Why take it back? (optional, it stays in the spec's record)"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>j("withdraw","Withdrawn. The spec is back to how it was.",{reason:l}),children:"Withdraw"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>o(!1),children:"Cancel"})]}):f?t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>o(!0),children:"Withdraw change"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad propose ${e.id} --withdraw`})]}):s?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(l),value:l,onChange:k=>u(k.target.value),placeholder:"Why not? (optional, it stays in the spec's record)"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>j("decline","Declined. Nothing changes.",{reason:l}),children:"Decline"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>r(!1),children:"Cancel"})]}):p.status==="proposed"||p.status==="design-ready"?t.jsxs("div",{className:"row",children:[t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>j("approve",p.status==="design-ready"?"Approved. The Builder redoes what changed.":p.size==="big"?"Approved. The Architect updates the design next.":"Approved. The spec says it now."),children:[t.jsx(ge,{size:14,strokeWidth:2.5})," ",p.status==="design-ready"?"Approve the new design":"Approve"]}),t.jsx("button",{className:"btn sm",onClick:()=>r(!0),children:p.status==="design-ready"?"Decline the change":"Decline"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:p.status==="design-ready"?`squad approve ${e.id}`:`squad propose ${e.id} --approve`})]}):p.status==="failed"?t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>j("retry","The Analyst writes it again."),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>j("decline","Dropped the change."),children:"Drop it"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad propose ${e.id} --retry`})]}):null]})})}function ll({t:e,initial:n="",from:s,onClose:r}){const i=pe(),[o,l,u]=Ne(e.id,"propose",n),d=Ds(e),p=si(e),f=()=>{u(),r()},m=!!o.trim()&&!i.isPending,x=Me(o.trim()||"…"),y=j=>i.mutate({path:`/api/v1/tickets/${e.id}/spec-change/new-ticket`,body:{text:o,as:j},done:j==="bug"?`Reported a bug, linked to ${e.id}.`:`Made a new ticket, linked to ${e.id}.`},{onSuccess:f});return t.jsxs(He,{title:d?"Ask for a change":"Propose a change",icon:t.jsx(vs,{size:16}),onClose:r,footer:t.jsxs(t.Fragment,{children:[d?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!m,onClick:()=>y("ticket"),children:[t.jsx(Nt,{size:15})," Make a new linked ticket"]}),t.jsxs("button",{className:"btn",disabled:!m,onClick:()=>y("bug"),children:[t.jsx(Os,{size:15})," Report a bug"]})]}):t.jsxs("button",{className:"btn pri",disabled:!m||!!p,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/spec-change`,body:{text:o,...s?{from:s}:{}},done:"Proposed. The Analyst writes it into the spec; the work goes on."},{onSuccess:f}),children:[t.jsx(vs,{size:15})," Propose"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:d?`squad propose ${e.id} --as ticket ${x}`:`squad propose ${e.id} ${x}`})]}),children:[t.jsx("p",{className:"note",style:{marginBottom:10},children:d?`${e.id} is ${e.stage==="done"?"released":"accepted"}${e.release?` (${e.release})`:""}, so it only answers questions. Your change becomes a new ticket linked to it, or a bug report.`:p?`Change ${p.id} is still open. One change at a time: approve or decline it first.`:"Say what should change. The Analyst writes it into the spec, old and new, and says if it is small or big. Nothing changes until you approve it, and the work goes on meanwhile."}),t.jsx("textarea",{className:"input",rows:4,style:{width:"100%"},autoFocus:!0,dir:xe(o),value:o,onChange:j=>l(j.target.value),placeholder:"For example: allow 5 bookings a day, not 3"})]})}function HR({t:e}){const[n,s]=C.useState(!1);return Uu(e)?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm",onClick:()=>s(!0),title:Ds(e)?"Becomes a new linked ticket or a bug report":"The Analyst writes it into the spec; you approve it",children:[t.jsx(vs,{size:13})," ",Ds(e)?"Ask for a change":"Propose a change"]}),n&&t.jsx(ll,{t:e,onClose:()=>s(!1)})]}):null}const VR={writing:"Being written",proposed:"Waits for you",approved:"Approved",designing:"Design update","design-ready":"Waits for you",building:"Being built",done:"In the spec",declined:"Declined",failed:"Not written"};function KR({t:e}){const n=[...e.changes??[]].reverse();return n.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Changes to the spec · ",n.length]}),t.jsx("ul",{className:"ticketnotes",children:n.map(s=>t.jsxs("li",{...De(s.summary??s.ask),children:[t.jsx("span",{className:`pill ${s.status==="done"?"ok":s.status==="declined"?"wait":"you"}`,children:s.decided?.withdrawn?"Withdrawn":VR[s.status]}),t.jsx(D,{className:"grow",text:`${s.id}: ${s.summary??s.ask}${s.size?` (${s.size})`:""}${s.decided?.reason?`. Why not: ${s.decided.reason}`:""}`}),t.jsx(D,{className:"note",text:s.by})]},s.id))})]}):null}function Gm(e){return!e.takenOver&&!(e.outside&&!e.sessions?.build)&&["implement","test","review"].includes(e.stage)}function Qm({t:e}){const n=pe();return t.jsxs("button",{className:"btn sm",disabled:n.isPending,title:"The squad stops. You work in the Builder's Claude Code session, then give it back.",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/take-over`,done:"It is yours. The squad waits until you give it back."}),children:[t.jsx(Ho,{size:12})," Take over"]})}const pt={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"},S2={analyst:"intake",architect:"intake",builder:"build",reviewer:"review",tester:"tester"},YR={analyst:ti,architect:em,builder:Ho,reviewer:tm,tester:im},GR={"analyst-read":"analyst",triage:"analyst","spec-rewrite":"analyst","chat-spec":"analyst","plan-write":"architect","plan-rewrite":"architect","answered-architect":"architect","chat-design":"architect",build:"builder",unstick:"builder",fix:"builder",test:"builder","review-fix":"builder","restore-tests":"builder","update-base":"builder","proof-fix":"builder","answered-builder":"builder","chat-carry-builder":"builder",review:"reviewer","answered-reviewer":"reviewer","chat-carry-reviewer":"reviewer",proof:"tester","chat-carry-tester":"tester"};function Dn({role:e,small:n,live:s}){const r=YR[e]??ti;return t.jsx("span",{className:`cav av-${e} ${n?"sm":""} ${s?"live":""}`,"aria-hidden":"true",children:t.jsx(r,{size:n?13:16,strokeWidth:2})})}function li({t:e,agent:n,label:s,primary:r,small:i}){const o=pe();return t.jsxs("button",{className:`btn ${r?"pri":""} ${i?"sm":""}`,disabled:o.isPending,onClick:()=>o.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:n}},{onSuccess:()=>gs.show(e.id)}),children:[t.jsx(Bn,{size:14})," ",s??`Talk to the ${pt[n]}`]})}function QR(e){return e.live&&e.squad?.phase?GR[e.squad.phase]??null:null}function Ab(e){if(e.stage==="done")return{text:`Released${e.release?` · ${e.release}`:""}`,tone:"done"};if(e.stage==="release")return{text:`Accepted${e.release?` · ready for ${e.release}`:""}`,tone:"done"};const n=_s[e.stage];return e.chat?.open&&!e.chat.beside?{text:`${n} · ${e.chat.thinking?"talking":"your turn"}`,tone:"you"}:e.waiting?{text:`${n} · your turn`,tone:"you"}:{text:`${n}${e.live?" · working":""}`,tone:e.live?"work":"you"}}function Pb(e){const n=e.chat,s=pt[n.with];return n.beside?Ds(e)?{kind:"released",note:"Questions only"}:oa(e)?{kind:"review",note:"Questions only"}:{kind:rR(e)?"working":"still",note:"Questions only"}:{kind:"talk",note:`The ${s} waits while you talk`}}function Rb(e){const n=e.chat,s=pt[n.with];return n.beside?null:n.with==="analyst"?{label:`${e.story?"Update":"Write"} the spec`,path:"write",done:`The Analyst is ${e.story?"updating":"writing"} the spec from your talk.`}:n.with==="architect"&&e.specApproved?{label:`${e.steps?"Update":"Write"} the design`,path:"write",done:`The Architect is ${e.steps?"updating":"writing"} the design from your talk.`}:n.with==="architect"?null:{label:"Back to work",path:"done",done:`The ${s} carries on as you agreed.`}}function ZR({t:e,size:n,onFull:s,onPanel:r}){const i=pe(),[o,l]=C.useState(!1),u=e.chat,d=pt[u.with],p=Pb(e),f=Ab(e),m=u.open?Rb(e):null,x=i.isPending||!!u.thinking,y=u.with==="builder"||u.with==="reviewer"||u.with==="tester",j=($,A)=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/${$}`,done:A}),k=t.jsxs(t.Fragment,{children:[u.open&&m&&t.jsxs("button",{className:"btn pri",disabled:x,onClick:()=>j(m.path,m.done),children:[t.jsx(ge,{size:15,strokeWidth:2.5})," ",m.label]}),u.open&&p.kind==="talk"&&!y&&t.jsx("button",{className:"btn",disabled:x,onClick:()=>j("done","Done talking."),children:m?"Done, no changes":"Done"}),u.open&&p.kind==="talk"&&y&&Gm(e)&&t.jsx(Qm,{t:e}),u.open&&p.kind==="released"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:()=>l(!0),children:[t.jsx(iy,{size:14})," New linked ticket"]}),t.jsxs("button",{className:"btn",onClick:()=>l(!0),children:[t.jsx(Os,{size:14})," Report a bug"]})]}),u.open&&p.kind==="working"&&Uu(e)&&t.jsxs("button",{className:"btn",onClick:()=>l(!0),children:[t.jsx(vs,{size:14})," Propose a change"]}),u.open&&p.kind!=="talk"&&t.jsx("button",{className:"btn",disabled:i.isPending,onClick:()=>j("done",`Done asking the ${d}.`),children:"Done"}),!u.open&&(u.beside||!e.takenOver)&&t.jsxs("button",{className:"btn",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:u.with,...u.beside?{ask:!0}:{}}},{onSuccess:()=>gs.show(e.id)}),children:[t.jsx(Bn,{size:14})," ",u.beside?`Ask the ${d} again`:`Talk to the ${d} again`]})]}),b=u.beside?oR(e):"",S=u.open&&p.kind==="working"?t.jsxs("div",{className:"cbanner work",children:[t.jsx("span",{className:"livedot","aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("b",{children:b}),e.status?t.jsxs(t.Fragment,{children:[" · ",e.status]}):null,". Asking never stops the work; a change goes through the spec."]})]}):u.open&&p.kind==="review"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Your questions change nothing on it."," ",e.waiting?.kind==="proof"?"To ask for a change, press Something's wrong.":"To go on, pick a way out on its card."]})}):u.open&&p.kind==="released"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Ask anything about it. A change becomes a new linked ticket or a bug report."]})}):u.open&&p.kind==="still"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Your questions change nothing on it."]})}):null,N=o?t.jsx(ll,{t:e,from:u.with,onClose:()=>l(!1)}):null;return n==="phone"?t.jsxs("div",{className:"chead-m",children:[t.jsxs("div",{className:"chead-m-row",children:[t.jsx(D,{className:"ctitle",text:e.title}),u.open&&m&&t.jsx("button",{className:"btn pri sm",disabled:x,onClick:()=>j(m.path,m.done),children:m.label}),u.open&&!m&&t.jsx("button",{className:"btn sm",disabled:i.isPending,onClick:()=>j("done","Done talking."),children:"Done"})]}),S,u.open&&p.kind==="released"&&t.jsxs("div",{className:"chead-m-row",children:[t.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[t.jsx(iy,{size:13})," New linked ticket"]}),t.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[t.jsx(Os,{size:13})," Report a bug"]})]}),N]}):n==="full"?t.jsxs("div",{className:"chead-f",children:[t.jsxs("div",{className:"chead-f-row",children:[t.jsx(Dn,{role:u.with,live:u.thinking}),t.jsxs("div",{className:"chead-f-t",children:[t.jsxs("div",{className:"chead-line",children:[t.jsx("span",{className:"cid",children:e.id}),t.jsx("span",{className:`cstage ${f.tone}`,children:f.text}),u.open&&t.jsx("span",{className:"cnote",children:p.note})]}),t.jsx(D,{as:"div",className:"ctitle",text:e.title})]}),t.jsx("span",{className:"grow"}),t.jsx("div",{className:"cbtns",children:k}),r&&t.jsx("button",{className:"iconbtn",onClick:r,"aria-label":"Back to the side panel",title:"Back to the side panel",children:t.jsx(gk,{size:16})})]}),S,N]}):t.jsxs("div",{className:"chead-p",children:[t.jsxs("div",{className:"chead-line",children:[t.jsx("span",{className:"cid",children:e.id}),t.jsx("span",{className:`cstage ${f.tone}`,children:f.text}),t.jsx("span",{className:"grow"}),u.open&&t.jsx("span",{className:"cnote",children:p.note}),s&&t.jsx("button",{className:"iconbtn sm",onClick:s,"aria-label":"Open full screen",title:"Full screen",children:t.jsx(Au,{size:14})})]}),t.jsx(D,{as:"div",className:"ctitle",text:e.title}),S,t.jsx("div",{className:"cbtns",children:k}),N]})}const Tc=e=>`${e.at}|${e.who}`,C2=e=>e.who!=="you"&&e.who!=="squad";function Zm({id:e,size:n,onOpenDoc:s,onFull:r,onPanel:i}){const o=Qo(e),l=o.data,u=l?.chat,d=C.useRef(null),[p,f]=Ne(e,"chat",""),m=C.useRef(null),x=C.useRef(null),[y,j]=C.useState(null),k=l?.chat?.messages.length??0;C.useEffect(()=>{y&&k>y.count&&j(null)},[k,y]);const b=u?u.beside?"chat":S2[u.with]:"",S=$e({queryKey:["conversation",e,b],queryFn:()=>Se(`/api/v1/tickets/${e}/conversations/${b}`),enabled:!!(u&&(u.beside?u.side:l?.sessions?.[S2[u.with]])),refetchInterval:u?.thinking?1500:8e3,retry:!1}),N=C.useMemo(()=>wb(S.data?.updates??[]).filter(Y=>Y.kind==="tool"),[S.data]),$=(Y,te)=>N.filter(P=>(!Y||(P.at??"")>=Y)&&(!te||(P.at??"")<=te)),A=C.useRef(null),[R,E]=C.useState(null),M=C.useMemo(()=>u?.messages??[],[u?.messages]);C.useEffect(()=>{if(!u)return;const Y=M.map(Tc);if(!A.current){A.current=new Set(Y);return}const te=M.filter(B=>!A.current.has(Tc(B)));for(const B of Y)A.current.add(B);const P=te.filter(C2).at(-1);P&&E({key:Tc(P),shown:0,total:P8(P.text)})},[u,M]),C.useEffect(()=>{if(!R)return;if(R.shown>=R.total){E(null);return}const Y=Math.max(1,Math.ceil(R.total/120)),te=setTimeout(()=>E(P=>P&&{...P,shown:P.shown+Y}),55);return()=>clearTimeout(te)},[R]);const F=C.useRef(!0),W=C.useRef(null);if(C.useLayoutEffect(()=>{const Y=d.current;Y&&F.current&&(Y.scrollTop=Y.scrollHeight)}),C.useEffect(()=>{const Y=d.current,te=W.current;if(!Y||!te)return;const P=new ResizeObserver(()=>{F.current&&(Y.scrollTop=Y.scrollHeight)});return P.observe(te),()=>P.disconnect()},[l?.id,!!u]),C.useEffect(()=>{u&&gs.seen(e,M.length)},[u,e,M.length]),!l)return t.jsx("div",{className:"cempty",children:o.isError?`No ticket ${e}.`:"Loading…"});if(!u)return t.jsxs("div",{className:"cempty",children:[t.jsxs("p",{children:["No talk on ",l.id," yet."]}),t.jsx(li,{t:l,agent:"analyst",primary:!0})]});const I=pt[u.with],q=Pb(l),L=[...M].reverse().find(Y=>Y.who==="you"),U=Rb(l),_=QR(l),G=q.kind==="working"?`You are asking the ${I}. ${_?`The ${pt[_]}`:"The squad"} keeps working on ${l.id}, and this talk changes nothing.`:q.kind==="review"||q.kind==="still"?`You are asking the ${I} about ${l.id}. It stays where it is, and this talk changes nothing.`:q.kind==="released"?`${l.id} is ${l.stage==="done"?"released":"accepted"}. Ask the ${I} anything about it.`:`You started talking with the ${I}. Its work on ${l.id} waits until you press ${U?U.label:"Done"}${U&&U.label!=="Back to work"?" or Done":""}.`,le=[...M].reverse().find(C2),V=Y=>{Y!==void 0&&f(Y),setTimeout(()=>m.current?.focus(),0)};return t.jsxs("div",{className:`chat-v csize-${n}`,children:[t.jsx(ZR,{t:l,size:n,onFull:r,onPanel:i}),t.jsx("div",{className:"cthread",ref:d,"aria-live":"polite",onScroll:Y=>{const te=Y.currentTarget;F.current=te.scrollHeight-te.scrollTop-te.clientHeight<80},children:t.jsxs("div",{className:"ccol",ref:W,children:[u.open&&t.jsx("div",{className:"cnote-pill",children:G}),M.map((Y,te)=>{if(Y.who==="squad")return t.jsx(aI,{t:l,m:Y,last:te===M.length-1,onAsk:()=>V()},te);if(Y.who==="you")return t.jsx(eI,{t:l,m:Y,onOpenDoc:s,onReply:z=>V(z)},te);const P=M[te-1],B=R?.key===Tc(Y),J=M[te+1];return t.jsx(tI,{t:l,m:Y,size:n,used:$(P?.at,Y.at),writing:B?R.shown:null,answer:J?.who==="you"?J.text:void 0,canChoose:u.open&&!u.thinking&&Y===le&&te===M.length-1,newest:Y===le,onChoose:z=>x.current?.(z),onOther:()=>V(),onOpenDoc:s,onReply:z=>V(z)},te)}),y&&t.jsx(XR,{p:y}),u.thinking&&M.at(-1)?.note!=="waits"&&t.jsx(iI,{role:u.with,steps:$(L?.at??M.at(-1)?.at),hasMessage:!!L})]})}),u.open?t.jsx(oI,{t:l,size:n,text:p,setText:f,input:m,onSent:()=>F.current=!0,sendRef:x,setPending:j}):t.jsx("div",{className:"cclosed",children:"This talk is over. It stays here to read."})]})}function XR({p:e}){const n=ht(e.text);return t.jsxs("div",{className:"cyou cmsg",children:[t.jsxs("div",{className:"cybub",children:[e.files.length>0&&t.jsx("div",{className:"cup",children:e.files.map((s,r)=>t.jsxs("div",{className:"cup-row",children:[s.preview?t.jsx("img",{className:"cup-img",src:s.preview,alt:""}):t.jsx("span",{className:"cfic sm file",children:(s.name.split(".").pop()??"").toUpperCase().slice(0,4)}),t.jsx("span",{className:"cfname",children:s.name}),t.jsx("span",{className:"cbar",children:t.jsx("i",{})})]},r))}),e.text.trim()&&t.jsx("p",{className:Bs(n),dir:n.dir,lang:n.dir==="rtl"?"ar":"en",children:e.text})]}),t.jsx("span",{className:"cmeta",children:"You · now · sending"})]})}function Ib({t:e,m:n,holder:s,onReply:r}){const i=pe(),{toast:o}=Le(),[l,u]=C.useState(!1),[d,p]=C.useState(!1),f=()=>{const j=window.getSelection();return((j&&!j.isCollapsed&&s.current?.contains(j.anchorNode)?j.toString().trim():"")||n.text).trim().slice(0,2e3)},m=(j,k)=>{u(!1),i.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:f(),kind:j},done:`Added to the spec as ${k}.`})},x=()=>void navigator.clipboard?.writeText(n.text).then(()=>o("Copied"),()=>o("Could not copy. Select the text instead.","err")),y=()=>r(`> ${n.text.replace(/\s+/g," ").slice(0,160)}${n.text.length>160?"…":""}
636
+
637
+ `);return t.jsxs("div",{className:"cacts",children:[t.jsxs("button",{className:"cact",onClick:x,children:[t.jsx(os,{size:13})," Copy"]}),n.who==="you"&&n.text.trim()&&Uu(e)&&t.jsxs("button",{className:"cact",onClick:()=>p(!0),children:[t.jsx(vs,{size:13})," Propose as a change"]}),!Ds(e)&&n.text.trim()&&t.jsxs("span",{className:"cmenu-w",children:[t.jsxs("button",{className:"cact",onClick:()=>u(!l),"aria-haspopup":"menu","aria-expanded":l,onMouseDown:j=>j.preventDefault(),children:[t.jsx(Nt,{size:13})," Add to spec"]}),l&&t.jsxs("div",{className:"cmenu",role:"menu",onMouseLeave:()=>u(!1),children:[t.jsxs("button",{role:"menuitem",onClick:()=>m("rule","a business rule"),onMouseDown:j=>j.preventDefault(),children:[t.jsx("b",{children:"A business rule"}),t.jsx("small",{children:"Every agent must follow it"})]}),t.jsxs("button",{role:"menuitem",onClick:()=>m("criterion",'a "done when" item'),onMouseDown:j=>j.preventDefault(),children:[t.jsx("b",{children:'A "done when" item'}),t.jsx("small",{children:"The Tester proves it with a screenshot"})]}),t.jsxs("button",{role:"menuitem",onClick:()=>m("note","a note"),onMouseDown:j=>j.preventDefault(),children:[t.jsx("b",{children:"A note"}),t.jsx("small",{children:"Context for the next steps"})]})]})]}),e.chat?.open&&t.jsxs("button",{className:"cact",onClick:y,children:[t.jsx(h8,{size:13})," Reply"]}),d&&t.jsx(ll,{t:e,initial:n.text,from:e.chat?.with,onClose:()=>p(!1)})]})}function JR(e){let n=!1;return e.split(`
638
+ `).map((s,r,i)=>{/^\s*```/.test(s)&&(n=!n);const o=i[r+1]??"";return!n&&s.trim()&&o.trim()&&!/^\s*([-*+]|\d+\.|>|```)\s/.test(o)?`${s}
639
+ `:s}).join(`
640
+ `)}function eI({t:e,m:n,onOpenDoc:s,onReply:r}){const i=C.useRef(null),[o,l]=C.useState(!1),u=!n.text.trim()&&(n.files??[]).some(d=>wf.test(d));return t.jsxs("div",{className:`cyou cmsg ${o?"picked":""}`,children:[t.jsxs("div",{className:"cybub",ref:i,onClick:()=>l(!o),children:[n.text.trim()&&t.jsx(Ao,{text:JR(n.text),ticket:e.id}),n.files&&n.files.length>0&&t.jsx(Bm,{ticket:e.id,files:n.files,onOpen:s,sent:!0,from:"From you"})]}),t.jsxs("span",{className:"cmeta",children:["You · ",Bc(n.at),u?" · written out from your voice":""]}),t.jsx(Ib,{t:e,m:n,holder:i,onReply:r})]})}function Bc(e){return new Date(e).toDateString()===new Date().toDateString()?Wn(e):`${Ws(e)} ${Wn(e)}`}function tI({t:e,m:n,size:s,used:r,writing:i,answer:o,canChoose:l,newest:u,onChoose:d,onOther:p,onOpenDoc:f,onReply:m}){const x=C.useRef(null),[y,j]=C.useState(!1),k=n.who,b=pt[k]??"Agent",S=i!==null,N=S?A8(n.text,i):n.text,$=t.jsx(Ao,{text:N,ticket:e.id,stream:S,caret:S});return t.jsxs("div",{className:`cag cmsg ag-${k} ${y?"picked":""}`,children:[t.jsx(Dn,{role:k,live:S}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:b}),S?t.jsx("span",{className:"shim",children:"Writing"}):t.jsx("span",{className:"ctime",children:Bc(n.at)})]}),t.jsxs("div",{className:"cagb",ref:x,onClick:A=>s==="phone"&&!A.target.closest("button, a")&&j(!y),children:[r.length>0&&t.jsx(rI,{steps:r}),S||u?$:t.jsx(BP,{lines:WP(n.text),children:$}),!S&&n.files&&n.files.length>0&&t.jsx(Bm,{ticket:e.id,files:n.files,onOpen:f,from:`From the ${b} · ${Bc(n.at)}`}),!S&&n.options&&n.options.length>0&&t.jsx(nI,{options:n.options,answer:o,can:l,onChoose:d,onOther:p})]}),!S&&s==="phone"&&t.jsxs("span",{className:"cmeta",children:[b," · ",Bc(n.at)]}),!S&&t.jsx(Ib,{t:e,m:n,holder:x,onReply:m})]})}function nI({options:e,answer:n,can:s,onChoose:r,onOther:i}){const o=ht(e.join(" ")),l=n?.trim();return t.jsxs("div",{className:"cchoices",dir:o.dir,children:[e.map(u=>{const d=ht(u),p=l?l===u.trim()?"on":"off":s?"":"off";return t.jsx("button",{className:`cch ${p} ${Bs(d)}`,lang:d.dir==="rtl"?"ar":"en",dir:d.dir,disabled:!s,onClick:()=>r(u),children:u},u)}),s&&t.jsx("button",{className:"cch other",onClick:i,dir:o.dir,children:o.dir==="rtl"?"إجابة أخرى…":"Something else…"})]})}function sI(e){let n=0,s=0;for(const r of e.content){if(r.type!=="diff")continue;const i=(r.oldText??"").split(`
641
+ `).filter(Boolean).length,o=r.newText.split(`
642
+ `).filter(Boolean).length;n+=Math.max(0,o-(r.oldText==null?0:Math.min(i,o))),s+=r.oldText==null?0:Math.max(0,i-o)}return{title:e.title,...n||s?{plus:n,minus:s}:{}}}function Fb({s:e}){const n=sI(e);return t.jsxs("div",{className:`cstep ${e.skipped?"skipped":e.status}`,children:[e.skipped?t.jsx(Vo,{size:13}):e.status==="completed"?t.jsx(ge,{size:13,strokeWidth:2.5}):e.status==="failed"?t.jsx(Qe,{size:13}):t.jsx(pn,{size:13,className:"spin"}),t.jsx("span",{className:"cstep-t",children:n.title}),n.plus!==void 0&&t.jsxs("span",{className:"cstep-n",children:[t.jsxs("span",{className:"add",children:["+",n.plus]})," ",t.jsxs("span",{className:"del",children:["−",n.minus]})]})]})}function rI({steps:e}){const[n,s]=C.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"cactv",onClick:()=>s(!n),"aria-expanded":n,children:[t.jsx(Tu,{size:13,style:{transform:n?"rotate(90deg)":void 0}})," Looked at ",e.length," ",e.length===1?"thing":"things"]}),n&&t.jsx("div",{className:"cactlist",children:e.map(r=>t.jsx(Fb,{s:r},r.id))})]})}function iI({role:e,steps:n,hasMessage:s}){const r=n.filter(l=>l.status==="in_progress").at(-1)??n.at(-1),i=r?r.title:s?"Reading your message":"Reading the ticket",o=n.slice(-6);return t.jsxs("div",{className:`cag cmsg ag-${e} thinking`,children:[t.jsx(Dn,{role:e,live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:pt[e]}),t.jsx("span",{className:"shim",children:i})]}),t.jsxs("div",{className:"cagb",children:[t.jsxs("span",{className:"cdots","aria-label":`The ${pt[e]} is answering`,children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),o.length>0&&t.jsxs("div",{className:"csteps",children:[n.length>o.length&&t.jsxs("div",{className:"cstep more",children:["and ",n.length-o.length," earlier steps"]}),o.map(l=>t.jsx(Fb,{s:l},l.id))]})]})]})}function aI({t:e,m:n,last:s,onAsk:r}){const i=pe(),o=n.note==="failed"||!n.note&&n.text.startsWith("Could not answer"),l=e.chat?pt[e.chat.with]:"agent",u=s&&e.chat?.open&&!e.chat.thinking&&(o||n.note==="stopped"),d=()=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/retry`});return o?t.jsxs("div",{className:"cfail cmsg",children:[t.jsxs("div",{className:"cfail-t",children:[t.jsx(jr,{size:15})," The ",l," could not answer. Nothing was lost.",t.jsx("span",{className:"cfail-why",children:n.text.replace(/^Could not answer:\s*/,"")})]}),u&&t.jsxs("div",{className:"cbtns",children:[t.jsx("button",{className:"btn pri sm",disabled:i.isPending,onClick:d,children:"Try again"}),t.jsx("button",{className:"btn sm",onClick:r,children:"Ask something else"})]})]}):t.jsxs("div",{className:"cnote-w cmsg",children:[t.jsx(D,{as:"div",className:"cnote-pill",text:n.text}),u&&t.jsx("div",{className:"cbtns",children:t.jsx("button",{className:"btn sm",disabled:i.isPending,onClick:d,children:"Ask again"})})]})}const $2=10*1024*1024;function oI({t:e,size:n,text:s,setText:r,input:i,onSent:o,sendRef:l,setPending:u}){const d=pe(),{toast:p}=Le(),f=e.chat,m=pt[f.with],[x,y]=C.useState([]),[j,k]=C.useState(!1),b=C.useRef(null),S=ht(s),N=S8(S),$=Math.min(6,Math.max(1,s.split(`
643
+ `).length)),A=async F=>{const W=[...F],I=W.find(L=>L.size>$2);I&&p(`${I.name} is larger than 10 MB.`,"err");const q=await Promise.all(W.filter(L=>L.size<=$2).slice(0,10).map(ol)).catch(L=>(p(L.message,"err"),[]));y(L=>[...L,...q].slice(0,10))},R=(F=s,W=[])=>{const I=[...x,...W];if(!F.trim()&&!I.length||f.thinking||d.isPending)return;u({text:F,files:I,count:f.messages.length});const q=s;r(""),y([]),o(),d.mutate({path:`/api/v1/tickets/${e.id}/chat/send`,body:{text:F,files:I.map(({name:L,data:U})=>({name:L,data:U}))}},{onError:()=>{u(null),r(q),y(I.filter(L=>!W.includes(L)))}})};l.current=F=>R(F);const E=()=>d.mutate({path:`/api/v1/tickets/${e.id}/chat/stop`}),M=n==="phone"?`Message the ${m}`:`Message the ${m} in Arabic or English`;return t.jsxs("div",{className:"ccomp",onDragOver:F=>(F.preventDefault(),k(!0)),onDragLeave:()=>k(!1),onDrop:F=>(F.preventDefault(),k(!1),void A(F.dataTransfer.files)),children:[j&&t.jsx("div",{className:"cdrop",children:"Drop files to add them to your message"}),t.jsx(lI,{who:m,size:n,onDone:F=>R(s,[F]),render:F=>F.on?F.box:t.jsxs("div",{className:`cbox ${n==="phone"?"m":""}`,children:[x.length>0&&t.jsx("div",{className:"cpicked",children:x.map((W,I)=>t.jsxs("span",{className:"chip",children:[W.preview?t.jsx("img",{src:W.preview,alt:""}):t.jsx(su,{size:12})," ",W.name,t.jsx("button",{className:"iconbtn","aria-label":`Remove ${W.name}`,onClick:()=>y(x.filter((q,L)=>L!==I)),children:t.jsx(Qe,{size:11})})]},I))}),n==="phone"&&t.jsx("button",{className:"ib","aria-label":"Add screenshots or files",onClick:()=>b.current?.click(),children:t.jsx(Nt,{size:20})}),t.jsx("textarea",{ref:i,className:`cta ${s?Bs(S):"t-en"}`,dir:s?S.dir:"auto",lang:S.dir==="rtl"?"ar":"en",rows:$,value:s,placeholder:M,"aria-label":"Your message",onChange:W=>r(W.target.value),onPaste:W=>{const I=[...W.clipboardData.files];I.length&&A(I)},onKeyDown:W=>{W.key==="Enter"&&!W.shiftKey&&!W.nativeEvent.isComposing&&(W.preventDefault(),R())}}),n==="phone"?f.thinking?t.jsx("button",{className:"csend m stop",onClick:E,"aria-label":"Stop the answer",children:t.jsx(is,{size:14,fill:"currentColor"})}):s.trim()||x.length?t.jsx("button",{className:"csend m",onClick:()=>R(),"aria-label":"Send",disabled:d.isPending,children:t.jsx(js,{size:18})}):t.jsx("button",{className:"csend m mic",onClick:F.start,"aria-label":"Record a voice note",children:t.jsx(sy,{size:18})}):t.jsxs("div",{className:"crow",children:[t.jsx("button",{className:"ib","aria-label":"Add screenshots or files",title:"Add screenshots or files",onClick:()=>b.current?.click(),children:t.jsx(su,{size:16})}),t.jsx("button",{className:"ib","aria-label":"Record a voice note",title:"Record a voice note",onClick:F.start,children:t.jsx(sy,{size:16})}),N&&t.jsx("span",{className:"clchip",children:N}),t.jsx("span",{className:"grow"}),f.thinking?t.jsxs("button",{className:"cstop",onClick:E,disabled:f.stopping||d.isPending,children:[t.jsx(is,{size:11,fill:"currentColor"})," ",f.stopping?"Stopping…":"Stop"]}):t.jsx("button",{className:"csend",onClick:()=>R(),disabled:d.isPending||!s.trim()&&!x.length,"aria-label":"Send",children:t.jsx(js,{size:17})})]}),t.jsx("input",{ref:b,type:"file",multiple:!0,hidden:!0,onChange:W=>W.target.files&&void A(W.target.files)})]})}),n!=="phone"&&t.jsx("div",{className:"chint",children:"Enter sends · Shift+Enter for a new line · It answers in the language you write"})]})}function lI({who:e,size:n,onDone:s,render:r}){const{toast:i}=Le(),[o,l]=C.useState(!1),[u,d]=C.useState(0),p=C.useRef(null),f=C.useRef(!1);C.useEffect(()=>{if(!o)return;const j=setInterval(()=>d(k=>k+1),1e3);return()=>clearInterval(j)},[o]),C.useEffect(()=>()=>p.current?.stream.getTracks().forEach(j=>j.stop()),[]);const m=async()=>{try{const j=await navigator.mediaDevices.getUserMedia({audio:!0}),k=["audio/webm","audio/ogg","audio/mp4"].find(N=>MediaRecorder.isTypeSupported?.(N))??"",b=new MediaRecorder(j,k?{mimeType:k}:void 0),S=[];b.ondataavailable=N=>N.data.size&&S.push(N.data),b.onstop=()=>{if(j.getTracks().forEach(E=>E.stop()),!f.current||!S.length)return;const N=b.mimeType||k||"audio/webm",$=N.includes("ogg")?"ogg":N.includes("mp4")?"m4a":"weba",A=new Date().toTimeString().slice(0,8).replace(/:/g,""),R=new File(S,`voice-note-${A}.${$}`,{type:N});ol(R).then(s)},p.current=b,f.current=!1,d(0),b.start(),l(!0)}catch{i("The microphone is not available. Allow it for this page, or attach a voice note file.","err")}},x=j=>{f.current=j,p.current?.stop(),l(!1)},y=t.jsxs("div",{className:`crec ${n==="phone"?"m":""}`,role:"group","aria-label":"Recording a voice note",children:[t.jsx("span",{className:"crdot"}),t.jsxs("span",{className:"crt",children:["0:",String(u).padStart(2,"0")," · Recording for the ",e]}),t.jsx("span",{className:"clw","aria-hidden":"true",children:Array.from({length:22},(j,k)=>t.jsx("i",{style:{animationDelay:`${k%7*.11}s`}},k))}),t.jsx("button",{className:"btn sm",onClick:()=>x(!1),children:"Cancel"}),t.jsx("button",{className:"btn sm pri",onClick:()=>x(!0),children:"Send"})]});return t.jsx(t.Fragment,{children:r({on:o,start:()=>void m(),box:y})})}function zb(e=3e3){return $e({queryKey:["requirements"],queryFn:()=>Se("/api/v1/requirements"),refetchInterval:e})}function cI(e){return e?ri(e.state.job)||!!e.state.build?.on||e.state.sync?.status==="running"||e.state.sync?.status==="pending"||e.counts.building>0||e.questions.some(n=>n.thinking):!1}function uI(e){return $e({queryKey:["requirement",e],queryFn:()=>Se(`/api/v1/requirements/${encodeURIComponent(e)}`),refetchInterval:n=>n.state.status==="error"?1e4:cI(n.state.data)?1e3:4e3,retry:!1})}function dI(e,n){return $e({queryKey:["requirement-send",e],queryFn:()=>Se(`/api/v1/requirements/${encodeURIComponent(e)}/send`),enabled:n,retry:!1,staleTime:0})}function Lb(e){if(!e||typeof e!="object")return null;const n=e;return Array.isArray(n.epics)&&typeof n.id=="string"?n:n.breakdown?Lb(n.breakdown):null}function At(){const e=Hn(),{toast:n}=Le(),s=Sj({mutationFn:({path:r,body:i,method:o="POST"})=>at(r,o,i??{}),onSuccess:(r,i)=>{const o=Lb(r);o&&e.setQueryData(["requirement",o.id],o),e.invalidateQueries({queryKey:["requirements"]}),e.invalidateQueries({queryKey:["board"]}),i.done&&n(i.done)},onError:(r,i)=>{i.quiet||n(Mb(r),"err",ek(r)?()=>s.mutate(i):void 0)}});return s}function Mb(e){return e instanceof $u&&e.status===404&&/^404\b/.test(e.message)?"This squad-kit cannot do that yet. Update squad-kit, then try again.":e instanceof Error?e.message:String(e)}function gu(e,n){const s=ta()??"";return`${Uo(`/api/v1/requirements/${encodeURIComponent(e)}/file`)}?path=${encodeURIComponent(n)}&t=${encodeURIComponent(s)}`}const qb=e=>`squad.send-plan.${wt??""}.${e}`;function T2(e,n){try{sessionStorage.setItem(qb(e),JSON.stringify(n))}catch{}}function Ob(e){try{const n=sessionStorage.getItem(qb(e)),s=n?JSON.parse(n):null;return s&&typeof s.items=="number"&&typeof s.links=="number"?s:null}catch{return null}}const Hu=e=>`/api/v1/requirements/${encodeURIComponent(e)}`,Sf=10*1024*1024,hI=10;function Zi(e){const n=e instanceof Error?e.message:String(e),s=/^(\d{3}) [^:]*: ?([\s\S]*)$/.exec(n);if(!s)return Mb(e);try{const r=JSON.parse(s[2]);if(r.error&&r.error!=="not found")return r.error}catch{}return s[1]==="404"?"This squad-kit cannot do that yet. Update squad-kit, then try again.":s[2]?.trim()||n}function _b(e){const n=/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase();return n==="pdf"?"pdf":n==="docx"?"docx":n==="md"||n==="markdown"?"markdown":n==="txt"||n==="text"?"text":null}const pI={pdf:"PDF",docx:"DOCX",markdown:"MD",text:"TXT"},fI={pdf:"PDF",docx:"Word document",markdown:"Markdown",text:"Text"};function mI(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const Cf=e=>e.replace(/\.[^.]+$/,"");async function Db(e){if(!_b(e.name))throw new Error(`${e.name}: squad-kit reads PDF, Word (.docx), Markdown and text files. Save the BRD as one of those, or paste the text.`);if(e.size>Sf)throw new Error(`${e.name} is larger than 10 MB.`);return ol(e)}function Bb({file:e,onPick:n,onClear:s,hint:r}){const[i,o]=C.useState(!1),l=e?_b(e.name):null;return t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:`rq-drop ${i?"over":""}`,onDragOver:u=>{u.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:u=>{u.preventDefault(),o(!1),n(u.dataTransfer.files)},children:[t.jsx("input",{type:"file",className:"sr-only",accept:".pdf,.docx,.md,.markdown,.txt",onChange:u=>n(u.target.files)}),t.jsx(g8,{size:24,"aria-hidden":"true"}),t.jsxs("b",{children:["Drop your BRD here, or ",t.jsx("u",{children:"choose a file"})]}),t.jsx("span",{children:r??"PDF, Word, Markdown or text, up to 10 MB"})]}),e&&l&&t.jsxs("div",{className:"rq-file",children:[t.jsx("span",{className:`rq-ftag ${l}`,children:pI[l]}),t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:e.name}),t.jsxs("span",{children:[mI(e.size),", ",fI[l]]})]}),t.jsx("button",{className:"iconbtn","aria-label":"Remove the file",onClick:s,children:t.jsx(Qe,{size:14})})]})]})}function gI({onClose:e}){const n=At(),s=Gt(),[r,i]=C.useState(null),[o,l,u]=Ne("add-brd","paste",!1),[d,p,f]=Ne("add-brd","text",""),[m,x,y]=Ne("add-brd","name",""),[j,k]=C.useState(!1),[b,S]=C.useState([]),[N,$]=C.useState(null),A=C.useRef(null),R=async I=>{const q=I?[...I][0]:void 0;if(q){$(null);try{const L=await Db(q);i(L),l(!1),j||x(Cf(q.name))}catch(L){$(L.message)}}},E=async I=>{const q=[...I??[]],L=q.find(_=>_.size>Sf);L&&$(`${L.name} is larger than 10 MB.`);const U=await Promise.all(q.filter(_=>_.size<=Sf).map(ol)).catch(_=>($(_.message),[]));S(_=>[..._,...U].slice(0,hI-1))},M=o?!!d.trim():!!r,F=o?`squad requirements add --paste${m.trim()?` --name ${Me(m.trim())}`:""}`:`squad requirements add ${r?Me(r.name):"<file>"}${r&&m.trim()&&m.trim()!==Cf(r.name)?` --name ${Me(m.trim())}`:""}${b.map(I=>` --with ${Me(I.name)}`).join("")}`,W=()=>{if(!M)return;$(null);const I=o?{text:d,...m.trim()?{name:m.trim()}:{},with:b.map(({name:q,data:L})=>({name:q,data:L}))}:{file:{name:r.name,data:r.data},...m.trim()?{name:m.trim()}:{},with:b.map(({name:q,data:L})=>({name:q,data:L}))};n.mutate({path:"/api/v1/requirements",body:I},{onSuccess:q=>{u(),f(),y(),e(),s({to:"/requirements/$id",params:{id:q.id}})},onError:q=>$(Zi(q))})};return t.jsxs(He,{title:"Add a BRD",onClose:e,losing:r||b.length?r?`the file ${r.name}`:"the attached files":null,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(re,{text:F})}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsxs("button",{className:"btn pri",disabled:!M||n.isPending,onClick:W,children:[n.isPending&&t.jsx(pn,{size:14,className:"spin"})," Break it down"]})]}),children:[t.jsx("p",{children:"The Analyst breaks it into epics, features and stories. Nothing is built or sent anywhere until you approve."}),t.jsxs("div",{className:"rq-add",children:[o?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-paste",children:"The BRD's text"}),t.jsx("textarea",{id:"rq-paste",className:"textarea rq-pastebox",autoFocus:!0,dir:xe(d),value:d,onChange:I=>p(I.target.value),placeholder:"Paste the whole document here. Headings help the Analyst find its parts."}),t.jsxs("div",{className:"rq-hint",children:["Have the file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>l(!1),children:"Choose a file instead"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx(Bb,{file:r,onPick:I=>void R(I),onClear:()=>i(null)}),t.jsxs("div",{className:"rq-hint",children:["No file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>l(!0),children:"Paste the text instead"})]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-name",children:"Name"}),t.jsx("input",{id:"rq-name",className:"input",dir:xe(m),value:m,placeholder:o?"Named after its first heading":"Named after the file",onChange:I=>{x(I.target.value),k(!0)}})]}),t.jsxs("div",{className:"rq-hint",children:["Screen mockups or other files that go with it?"," ",t.jsx("button",{className:"rq-link",onClick:()=>A.current?.click(),children:"Add them"}),t.jsx("input",{ref:A,type:"file",multiple:!0,className:"sr-only",tabIndex:-1,"aria-hidden":"true",onChange:I=>void E(I.target.files)})]}),b.length>0&&t.jsx("div",{className:"rq-extras",children:b.map((I,q)=>t.jsxs("span",{className:"rq-extra",children:[t.jsx(n8,{size:13,"aria-hidden":"true"}),I.name,t.jsx("button",{"aria-label":`Remove ${I.name}`,onClick:()=>S(L=>L.filter((U,_)=>_!==q)),children:t.jsx(Qe,{size:12})})]},`${I.name}-${q}`))}),N&&t.jsx("p",{className:"rq-err",role:"alert",children:N}),t.jsxs("div",{className:"rq-next",children:[t.jsx("div",{className:"rq-next-h",children:"What happens next"}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"1"}),"The Analyst reads it and asks you only about parts that are missing or that clash."]}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"2"}),"You edit the breakdown and approve it."]}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"3"}),"Send it to Azure DevOps, let the squad build it story by story, or both."]})]})]})]})}function xI({v:e,onClose:n}){const s=At(),r=dI(e.id,!0),[i,o]=C.useState(!1),[l,u]=C.useState(null),[d,p]=C.useState(null),f=e.tracker?.label??"the tracker",m=e.state.sync,x=i&&!l&&(s.isPending||!m||m.status==="running"||m.status==="pending"),y=i&&m?.status==="done"&&!s.isPending,j=i&&m?.status==="failed"||!!l,k=r.data,b=Z7(e),S=s.isPending?of(void 0):of(m,d??Ob(e.id)),N=nv(S),$=async()=>{u(null),o(!0);const E=j?(await r.refetch()).data??k:k,M=E?{items:E.items,links:E.first?E.counts.links:E.links}:null;p(M),M&&T2(e.id,M),s.mutate({path:`${Hu(e.id)}/send`,quiet:!0},{onSuccess:F=>M&&F?.state?.sync?.at&&T2(e.id,{...M,at:F.state.sync.at}),onError:F=>u(Zi(F))})},A=k?.tracker.project??e.tracker?.project,R=k&&k.items===0&&k.links===0;return t.jsxs(He,{title:`Send to ${f}`,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(re,{text:`squad requirements send ${e.id}`})}),x||y?t.jsx("button",{className:"btn",onClick:n,children:"Close"}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),j?t.jsxs("button",{className:"btn pri",onClick:()=>void $(),disabled:s.isPending,children:[t.jsx(Kr,{size:14})," Send again"]}):t.jsx("button",{className:"btn pri",onClick:()=>void $(),disabled:!k||!!R||s.isPending,children:k?k.first?`Send ${k.items} items`:"Send changes":"Send"})]})]}),children:[t.jsxs("p",{children:["Into ",A?t.jsxs(t.Fragment,{children:["project ",t.jsx("b",{className:"rq-ink",children:A})]}):`your ${f} project`,", as the work item types it uses. They go into the backlog, not a sprint."]}),r.isLoading?t.jsx("p",{className:"note",children:"Working out what to send…"}):r.isError?t.jsxs("div",{className:"rq-err",role:"alert",children:["squad-kit could not work out what to send. ",Zi(r.error)," ",t.jsx("button",{className:"rq-link",onClick:()=>void r.refetch(),children:"Try again"})]}):k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"rq-send",children:[t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.counts.epics.all}),sp(k.levels.epic),t.jsx("span",{children:rp(k.counts.epics,k.first)})]}),k.counts.features.all>0&&t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.counts.features.all}),sp(k.levels.feature),", each under its epic",t.jsx("span",{children:rp(k.counts.features,k.first)})]}),t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.counts.stories.all}),sp(k.levels.story),", each under its ",k.counts.storiesUnderEpic?k.counts.features.all?"feature or epic":"epic":"feature",t.jsx("span",{children:k.first?'with "done when" as acceptance criteria':rp(k.counts.stories,!1)})]}),(k.first?k.counts.links:k.links)>0&&t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.first?k.counts.links:k.links}),k.first?"Links between stories that need each other":"New links between stories that need each other",b&&t.jsx(D,{text:`"${b}"`})]})]}),R&&t.jsx("p",{className:"note",children:"Everything is sent already. Edit the breakdown and Send changes updates the same items."})]}):null,t.jsxs("div",{className:"rq-promise",children:[t.jsx("div",{children:"Each story's number, like AB#120, shows in the breakdown. When the squad builds a story, its item moves forward and gets the squad's notes, as tickets from the Backlog do today."}),t.jsxs("div",{children:["Edit the breakdown later and ",t.jsx("b",{children:"Send changes"})," updates the same items. squad-kit never deletes anything in ",f,"."]})]}),i&&(x||y||j)&&t.jsx("div",{className:`rq-sendprog ${j?"fail":""}`,role:"status",children:j?t.jsxs("span",{children:[t.jsx("b",{children:"The send stopped."})," ",l??m?.error??"Something went wrong on the way."," What was sent stays sent; Send again carries on without doubles."]}):y?t.jsxs("span",{children:[t.jsx("b",{children:"Sent."})," Each item's number shows in the breakdown now."]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[S.phase==="links"?`${N.charAt(0).toUpperCase()}${N.slice(1)}`:`Sending${N?` ${N}`:""}`,"… You can close this: it carries on."]}),t.jsx("span",{className:"rq-pbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":S.pct,"aria-label":"Sent so far",children:t.jsx("i",{style:{width:`${S.pct||5}%`}})})]})})]})}function yI({v:e,item:n,text:s,onClose:r}){const i=At(),[o,l]=C.useState(s??""),u=n===e.id,d=u?null:Un(e,n),p=e.status==="approved"&&el(e).some(({story:m})=>m.ticket),f=()=>i.mutate({path:`${Hu(e.id)}/items/${encodeURIComponent(n)}/redo`,body:{ask:o.trim()},done:`The Analyst is redoing ${u?"the breakdown":n}.`},{onSuccess:r});return t.jsxs(He,{title:u?"Ask the Analyst":`Ask the Analyst to redo ${n}`,onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(re,{text:`squad requirements redo ${e.id} ${n} ${Me(o.trim()||"what to change")}`})}),t.jsx("button",{className:"btn",onClick:r,children:"Cancel"}),t.jsx("button",{className:"btn pri",disabled:!o.trim()||i.isPending,onClick:f,children:"Ask the Analyst"})]}),children:[t.jsx(D,{as:"p",text:`${u?"Say what to change in the breakdown, or what to add. The Analyst rewrites it and keeps the keys of what stays.":`Say what to change in ${n} ${d?.item.title??""}. The Analyst rewrites it and keeps its key.`}${p?" Stories that started stay as they are.":""}`}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ask",children:"What should change"}),t.jsx("textarea",{id:"rq-ask",className:"textarea",autoFocus:!0,dir:xe(o),value:o,onChange:m=>l(m.target.value),placeholder:u?"Add a story for staff to export bookings, under Admin and reports.":"Split it in two: one for holding the slot, one for freeing it."})]})]})}function jI({v:e,level:n,under:s,onClose:r,onAdded:i}){const o=At(),l=C.useMemo(()=>n==="feature"?e.epics.map(N=>({key:N.key,label:`${N.key} ${N.title}`})):n==="story"?e.epics.flatMap(N=>[...N.features.map($=>({key:$.key,label:`${N.title} › ${$.title}`})),{key:N.key,label:`${N.title}, straight under the epic`}]):[],[e.epics,n]),[u,d]=C.useState(s&&l.some(N=>N.key===s)?s:l.at(n==="story"?0:-1)?.key??""),[p,f,m]=Ne(e.id,`add-${n}-title`,""),[x,y,j]=Ne(e.id,`add-${n}-about`,""),k=n==="epic"?"an epic":`a ${n}`,b=!p.trim()||n!=="epic"&&!u||o.isPending,S=()=>{b||o.mutate({path:`${Hu(e.id)}/items`,body:{title:p.trim(),...n!=="epic"?{under:u,level:n}:{},...x.trim()?n==="epic"?{goal:x.trim()}:n==="feature"?{summary:x.trim()}:{story:x.trim()}:{}}},{onSuccess:N=>{m(),j(),i(N.key),r()}})};return t.jsxs(He,{title:`Add ${k}`,onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(re,{text:`squad requirements add-item ${e.id}${n!=="epic"?` --under ${u}`:""}${n==="feature"?" --feature":""} --title ${Me(p.trim()||"…")}`})}),t.jsx("button",{className:"btn",onClick:r,children:"Cancel"}),t.jsxs("button",{className:"btn pri",disabled:b,onClick:S,children:["Add ",k]})]}),children:[n!=="epic"&&t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-under",children:"Under"}),t.jsx("select",{id:"rq-under",className:"select",value:u,onChange:N=>d(N.target.value),children:l.map(N=>t.jsx("option",{value:N.key,children:as(N.label)},N.key))})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-title",children:"Title"}),t.jsx("input",{id:"rq-title",className:"input",autoFocus:!0,dir:xe(p),value:p,onChange:N=>f(N.target.value),onKeyDown:N=>N.key==="Enter"&&S()})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-about",children:n==="epic"?"What it is for":n==="feature"?"What it covers":"Story"}),t.jsx("textarea",{id:"rq-about",className:"textarea",dir:xe(x),value:x,onChange:N=>y(N.target.value),placeholder:n==="story"?"As a …, I want …, so that …":"One or two sentences"})]}),n==="story"&&t.jsx("p",{className:"note",children:'Add its "done when" checks on its panel before you approve.'})]})}function kI({v:e,onClose:n,onOpenRef:s,onAsk:r}){return t.jsxs(He,{title:`${e.leftOut.length} ${e.leftOut.length===1?"part":"parts"} left out`,onClose:n,children:[t.jsx("p",{children:"Parts of the BRD the breakdown leaves out on purpose, and why. Ask the Analyst to add one if it should be built."}),t.jsx("div",{className:"rq-leftout",children:e.leftOut.map((i,o)=>t.jsxs("div",{className:"rq-lo",children:[t.jsx(D,{as:"b",text:i.text}),t.jsx(D,{text:i.why}),t.jsxs("div",{className:"rq-lo-acts",children:[i.ref&&t.jsx("button",{className:"rq-link",onClick:()=>s(i.ref),children:t.jsx(D,{text:Jo(i.ref)})}),r&&t.jsxs("button",{className:"btn sm",onClick:()=>r(xy(i)),title:`squad requirements redo ${e.id} ${e.id} ${Me(xy(i))}`,children:[t.jsx(Bn,{size:13})," Ask the Analyst to add it"]})]})]},o))})]})}function E2({items:e,ok:n}){return t.jsx("ul",{className:"rmlist",children:e.map(s=>t.jsxs("li",{children:[n?t.jsx(ge,{size:16,className:"ok","aria-hidden":!0}):t.jsx(Qe,{size:16,className:"x","aria-hidden":!0}),t.jsx("span",{children:s})]},s))})}function Wb({id:e,title:n,sentTo:s,onClose:r,onDeleted:i}){const o=At(),[l,u]=C.useState(null),d=()=>o.mutate({path:Hu(e),method:"DELETE",quiet:!0,done:`Deleted ${e}.`},{onSuccess:()=>{r(),i?.()},onError:p=>u(Zi(p))});return Cu.createPortal(t.jsxs(He,{title:`Delete ${e}?`,icon:t.jsx("span",{className:"glyph",children:t.jsx(Cn,{size:15})}),onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn danger",disabled:o.isPending,onClick:d,children:[t.jsx(Cn,{size:15})," ",o.isPending?"Deleting…":`Delete ${e}`]}),t.jsx("button",{className:"btn",onClick:r,children:l?"Keep it":"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad requirements delete ${e}`})]}),children:[t.jsx(D,{as:"p",text:n}),l&&t.jsx("div",{className:"stuckbox rm-gap",role:"alert",children:l}),t.jsx("div",{className:"lbl",children:"This removes"}),t.jsx(E2,{items:["The breakdown: its epics, features and stories, and what was decided for you",`The document, its text and its pictures (.squad/requirements/${e})`,"What this computer kept about it: the Analyst's progress and the build switch"]}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(E2,{ok:!0,items:["Tickets that started from its stories, with their code and history",...s?[`Its items in ${s}: squad-kit never deletes there`]:[]]}),t.jsx("p",{className:"rm-note",children:"It cannot be deleted while its stories build. Wait until they merge, or delete those tickets first."})]}),document.body)}function Ub({choices:e,label:n="More actions"}){const[s,r]=C.useState(!1),i=C.useRef(null);return C.useEffect(()=>{if(!s)return;const o=u=>i.current&&!i.current.contains(u.target)&&r(!1),l=u=>{u.key==="Escape"&&(u.preventDefault(),r(!1))};return document.addEventListener("mousedown",o),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",l)}},[s]),e.length?t.jsxs("span",{className:"more rq-more",ref:i,children:[t.jsx("button",{className:"iconbtn","aria-label":n,"aria-haspopup":"menu","aria-expanded":s,title:n,onClick:()=>r(!s),children:t.jsx(ck,{size:16})}),s&&t.jsx("div",{className:"more-menu",role:"menu",children:e.map(o=>t.jsx("button",{role:"menuitem",className:o.danger?"danger":"",title:o.title,onClick:()=>{r(!1),o.onPick()},children:o.label},o.key))})]}):null}function vI(e,n){return`${gu(e.id,e.source.file)}${n?.page?`#page=${n.page}`:""}`}async function bI(e,n){const s=await fetch(gu(e,n));if(!s.ok)throw new Error(s.status===404?"not found":`${s.status}`);return s.text()}function Hb({v:e,at:n,onClose:s}){const[r,i]=C.useState(null),[o,l]=C.useState(null),u=C.useRef(null),d=Math.max(1,e.source.kind==="pdf"?0:e.source.pages??1);C.useEffect(()=>{let f=!0;const m=Array.from({length:d},(x,y)=>`text/part-${String(y+1).padStart(2,"0")}.md`);return Promise.all(m.map(x=>bI(e.id,x).catch(()=>""))).then(x=>{f&&(x.some(Boolean)||l("squad-kit could not open the text of this document. Download the original instead."),i(x))}).catch(()=>f&&l("squad-kit could not open the text of this document.")),()=>{f=!1}},[e.id,d]),C.useEffect(()=>{if(!r||!n||!u.current)return;const f=[...u.current.querySelectorAll("h1, h2, h3, h4, h5, h6")],m=y=>{const j=(y.textContent??"").trim().toLowerCase();return n.section&&(j===n.section.toLowerCase()||j.startsWith(`${n.section.toLowerCase()} `))||n.title&&j.includes(n.title.toLowerCase())},x=f.find(m);x&&(x.classList.add("rq-hit"),x.scrollIntoView({block:"start"}))},[r,n]);const p=f=>/^(https?:|data:)/.test(f)?f:gu(e.id,f.replace(/^(\.\.\/)+/,""));return t.jsx(He,{wide:!0,title:e.source.name,onClose:s,footer:t.jsxs(t.Fragment,{children:[n&&t.jsx(D,{className:"note",text:Jo(n)}),t.jsx("span",{className:"grow"}),t.jsxs("a",{className:"btn",href:gu(e.id,e.source.file),target:"_blank",rel:"noreferrer",download:e.source.name,children:[t.jsx(ks,{size:14})," The original"]}),t.jsx("button",{className:"btn pri",onClick:s,children:"Close"})]}),children:t.jsx("div",{className:"rq-doc",ref:u,children:o?t.jsx("p",{className:"rq-err",children:o}):r?r.map((f,m)=>t.jsx(Im,{remarkPlugins:[qm],rehypePlugins:[cm],components:{img:({src:x,alt:y})=>t.jsx("img",{src:x?p(x):"",alt:y??"",loading:"lazy"}),a:({href:x,children:y})=>t.jsxs("a",{href:x,target:"_blank",rel:"noreferrer",children:[y," ",t.jsx(xs,{size:11})]})},children:f},m)):t.jsx("p",{className:"note",children:"Opening the document…"})})})}function Vb(e){const[n,s]=C.useState(void 0);return{open:r=>{e&&(e.source.kind==="pdf"?window.open(vI(e,r),"_blank","noopener"):s(r??null))},viewer:n,close:()=>s(void 0)}}function wI(e,n,s){return el(e).filter(({story:r})=>r.key!==n&&!s.includes(r.key)).map(({story:r})=>({key:r.key,label:`${r.key} ${r.title}`}))}const NI={gap:"Missing in the BRD",clash:"Two parts clash",check:"A check failed"};function Xm(e){if(e.track!=="auto"||!e.waiting)return null;if(e.waiting.kind==="ask"&&e.agentQuestion?.kind&&!e.agentQuestion.answer)return e.agentQuestion.kind;const n=e.waiting.kind==="stuck"?e.stuck?.gate:void 0;return n==="checks"||n==="review"||n==="proof"?"check":null}function Kb(e,n){return`/requirements/${encodeURIComponent(e)}${n?`?item=${encodeURIComponent(n)}`:""}`}function SI(e,n){for(const s of e?.epics??[]){for(const r of s.features)if(r.stories.some(i=>i.key===n))return[s.title,r.title,n].join(" › ");if(s.stories.some(r=>r.key===n))return[s.title,n].join(" › ")}return n}const A2=/\s*\(suggested\)\s*$/i;function CI(e){return e.map(n=>({text:n.replace(A2,""),suggested:A2.test(n)}))}function $I(e){return e.stage==="specs"?"planning":e.stage==="implement"?"building":e.stage==="test"?"testing":e.stage==="review"?"reviewing":"working"}function TI(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function EI(e,n){const s=e.epics.flatMap(l=>[...l.features.flatMap(u=>u.stories),...l.stories]),r=new Set(e.progress.filter(l=>l.state==="merged"||l.state==="released").map(l=>l.key)),i=new Set,o=l=>{for(const u of s)u.dependsOn.includes(l)&&!i.has(u.key)&&(i.add(u.key),o(u.key))};return o(n),s.filter(l=>i.has(l.key)&&!r.has(l.key)).map(l=>`${l.key} ${l.title}`)}function AI(e,n){if(!e||!n.breakdown)return"";const s=EI(e,n.breakdown.item),r=!!e.state.build?.on;return s.length?`${TI(s)} ${s.length===1?"waits":"wait"} for your answer.${r?" The other stories keep building.":""}`:r?"No other story waits for it: the others keep building.":""}function PI(e){return e.ticket||!e.page&&!e.section?null:{...e.section?{section:e.section}:{},...e.page?{page:e.page}:{}}}function Yb(e){return $e({queryKey:["requirements",e,"view"],queryFn:()=>Se(`/api/v1/requirements/${e}`),enabled:!!e,refetchInterval:4e3})}function Jm({id:e,item:n,children:s,className:r}){const i=hn(),o=Kb(e,n),l=u=>{u.metaKey||u.ctrlKey||u.shiftKey||u.button!==0||(u.preventDefault(),i.navigate({href:`${Hi}${o}`}))};return t.jsx("a",{className:r,href:`${Hi}${o}`,onClick:l,children:s})}function RI({t:e}){return e.track==="auto"?t.jsx("span",{className:"autochip",children:"Builds by itself"}):t.jsxs(t.Fragment,{children:[t.jsx("b",{children:e.track==="express"?"Express":"Full"})," track"]})}function II({t:e}){const n=Yb(e.breakdown?.id).data;return e.breakdown?t.jsxs("div",{className:"brdplace",children:["From"," ",t.jsx(Jm,{id:e.breakdown.id,item:e.breakdown.item,children:e.breakdown.id})," ","› ",t.jsx(Tk,{path:SI(n,e.breakdown.item)})]}):null}function FI({t:e}){return e.track!=="auto"?null:t.jsx("span",{className:"prio auto",children:"Builds by itself"})}function zI({t:e}){return e.breakdown?t.jsxs("div",{className:"bkey",title:`From ${e.breakdown.id} › ${e.breakdown.item}`,children:[e.breakdown.id," › ",e.breakdown.item]}):null}function Gb({kind:e}){return t.jsx("span",{className:`stoptag ${e}`,children:NI[e]})}function LI({t:e,extra:n}){const s=pe(),r=e.agentQuestion,i=r.kind,o=Yb(e.breakdown?.id).data,l=CI(r.options),[u,d]=C.useState(()=>l.find(k=>k.suggested)?.text??null),[p,f]=Ne(e.id,"stop-own",""),m=pt[r.from],x=u===""?p.trim():u,y=AI(o,e),j=Vb(o);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("section",{className:"stopcard","aria-label":"Needs you",children:[t.jsxs("div",{className:"stophead",children:[t.jsx(Gb,{kind:i}),t.jsxs("span",{children:["The ",m," found it while ",$I(e),", ",St(r.at)]})]}),t.jsx(D,{as:"p",className:"stuckq",text:r.text}),t.jsx(MI,{list:r.sources,onOpenRef:o?j.open:void 0}),r.files&&r.files.length>0&&t.jsx(xb,{ticket:e.id,files:r.files}),t.jsxs("div",{className:"opts2",children:[l.map(k=>t.jsxs("button",{className:`opt2 ${u===k.text?"pick":""}`,...De(k.text),onClick:()=>d(k.text),"aria-pressed":u===k.text,children:[t.jsx("b",{children:t.jsx(D,{text:k.text})}),(k.suggested||u===k.text)&&t.jsxs("span",{className:"optfoot",children:[k.suggested&&t.jsxs("span",{className:"rec",children:[m," suggests"]}),u===k.text&&t.jsxs("span",{className:"yourpick",children:[t.jsx(ge,{size:13,strokeWidth:2.5})," Your pick"]})]})]},k.text)),t.jsx("button",{className:`opt2 ${u===""?"pick":""}`,onClick:()=>d(""),"aria-pressed":u==="",children:t.jsx("b",{children:"Something else…"})})]}),u===""&&t.jsx("textarea",{className:"input",rows:3,style:{width:"100%"},autoFocus:!0,dir:xe(p),value:p,placeholder:"Your answer",onChange:k=>f(k.target.value)}),(r.why||y)&&t.jsx(D,{as:"p",className:"stopwhy",text:[r.why,y].filter(Boolean).join(" ")})]}),t.jsx(e1,{t:e}),n]}),o&&j.viewer!==void 0&&Cu.createPortal(t.jsx(Hb,{v:o,at:j.viewer??void 0,onClose:j.close}),document.body),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn you",disabled:!x||s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:x},done:`Sent. The ${m} carries on.`}),children:[t.jsx(ws,{size:15})," Answer"]}),!e.chat?.open&&t.jsx(li,{t:e,agent:r.from,label:"Ask about this"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad reply ${e.id}${x?` ${Me(x.length>40?`${x.slice(0,40)}…`:x)}`:""}`})]})]})}function MI({list:e,onOpenRef:n}){return e?.length?t.jsxs("p",{className:"stopsrc",children:["Sources:"," ",e.map((s,r)=>{const i=PI(s);return t.jsxs("span",{children:[r>0&&" · ",s.ticket?t.jsx(Ce,{to:"/board",search:{ticket:s.ticket},children:t.jsx(D,{text:s.text})}):i&&n?t.jsx("button",{className:"linkbtn",onClick:()=>n(i),title:"Open this place in the document",children:t.jsx(D,{text:s.text})}):t.jsx(D,{text:s.text})]},`${s.text}-${r}`)})]}):null}function Qb(e){return e.by==="answer"?"from your answer":`${e.by.charAt(0).toUpperCase()}${e.by.slice(1)}`}function qI({d:e}){const n=e.changed?.ticket;return n?/^c\d+$/.test(n)?t.jsxs("span",{className:"became",children:["It became change ",n," on this ticket."]}):t.jsxs("span",{className:"became",children:["It became"," ",t.jsx(Ce,{to:"/board",search:{ticket:n},children:n}),", linked to this one."]}):null}function e1({t:e}){const n=la(),[s,r]=C.useState(null),i=e.decided??[];if(!i.length)return null;const o=_n(e,n)||!n;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Decided for you on this story"}),t.jsx("ul",{className:"decided",children:i.map(l=>t.jsxs("li",{children:[t.jsxs("span",{className:"dwho",children:[Qb(l)," · ",St(l.at)]}),l.changed?t.jsxs(t.Fragment,{children:[t.jsx(D,{className:"was",text:l.text}),t.jsx(D,{lead:t.jsx("b",{children:"Now:"}),text:l.changed.text}),t.jsx(qI,{d:l})]}):t.jsxs(t.Fragment,{children:[t.jsx(D,{text:l.text}),o&&t.jsx("button",{className:"linkbtn",onClick:()=>r(l),children:"Change"})]})]},l.id))}),s&&t.jsx(OI,{t:e,d:s,onClose:()=>r(null)})]})}function OI({t:e,d:n,onClose:s}){const r=pe(),{toast:i}=Le(),[o,l,u]=Ne(e.id,`decided-${n.id}`,""),d=Ds(e),p=o.trim();return t.jsxs(He,{title:"Change what was decided",icon:t.jsx(vs,{size:16}),onClose:s,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!p||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/decided/${n.id}`,body:{text:p}},{onSuccess:f=>{i(sv(e.id,f?.decided?.find(m=>m.id===n.id)?.changed?.ticket)),u(),s()}}),children:[t.jsx(vs,{size:15})," Change it"]}),t.jsx("button",{className:"btn",onClick:s,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad decided ${e.id} ${n.id} ${Me(p||"what you want instead")}`})]}),children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:n.by==="answer"?"From your answer, the squad decided:":`The ${Qb(n)} decided:`}),t.jsx(D,{as:"div",className:"decidedq",text:n.text}),t.jsx("label",{className:"lbl",htmlFor:"decided-instead",style:{marginTop:0},children:"What do you want instead?"}),t.jsx("textarea",{id:"decided-instead",className:"input",rows:3,style:{width:"100%"},autoFocus:!0,dir:xe(o),value:o,onChange:f=>l(f.target.value),placeholder:"For example: the refund goes back as store credit"}),t.jsx("p",{className:"note",style:{marginTop:8},children:d?`${e.id} is merged, so this becomes a new ticket linked to it.`:"It becomes a small change on this ticket: the Analyst writes it into the spec, you approve it, and the Builder makes it."})]})}function Vu(){return $e({queryKey:["requirements","waiting"],queryFn:()=>Se("/api/v1/requirements/waiting"),enabled:!!wt,refetchInterval:3e3}).data?.breakdowns??[]}function Zb(){const n=($e({queryKey:["app","projects"],queryFn:()=>Se("/api/v1/app/projects"),refetchInterval:2e3}).data?.projects??[]).filter(r=>r.open);return W5({queries:n.map(r=>({queryKey:["app","requirements-waiting",r.id],queryFn:()=>Se(`/p/${encodeURIComponent(r.id)}/api/v1/requirements/waiting`),refetchInterval:3e3,retry:!1}))}).flatMap((r,i)=>(r.data?.breakdowns??[]).map(o=>({...o,project:{id:n[i].id,name:n[i].name}})))}function Xb(e){return`/p/${encodeURIComponent(e.project.id)}${Kb(e.id)}`}function _I(e){return`squad requirements answer ${e.id}${e.project?` --project ${na(e.project.name)}`:""}`}function $f(e){return`The Analyst has ${e.questions} ${e.questions===1?"question":"questions"}`}function DI({w:e}){return t.jsxs("div",{className:"yitem",title:`${e.project?`${e.project.name} · `:""}${e.id} · ${e.title}
644
+ ${$f(e)}`,children:[t.jsx("span",{className:"yid",children:e.project?`${e.project.name} · ${e.id}`:e.id}),t.jsx("span",{className:"yline",children:$f(e)}),e.project?t.jsx("a",{className:"btn sm you",href:Xb(e),children:"Answer"}):t.jsx(Jm,{id:e.id,className:"btn sm you",children:"Answer"})]})}function Jb({w:e}){return t.jsxs("div",{className:"wcard",style:{padding:"16px 18px 16px 22px"},children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[e.project&&t.jsx("span",{className:"pill sm",children:e.project.name}),t.jsx("span",{className:"id",children:e.id}),t.jsx("span",{children:"Requirements"}),t.jsx("span",{children:St(e.since)})]}),t.jsx(D,{as:"h3",text:e.title}),t.jsxs("p",{children:[$f(e),". It writes the breakdown once you answer."]})]}),t.jsx(re,{text:_I(e)}),e.project?t.jsx("a",{className:"btn pri sm",href:Xb(e),children:"Answer"}):t.jsx(Jm,{id:e.id,className:"btn pri sm",children:"Answer"})]})}function ew({t:e}){const n=Xm(e);return n?t.jsx(Gb,{kind:n}):null}function tw(){return $e({queryKey:["app","waiting"],queryFn:()=>Se("/api/v1/app/waiting"),refetchInterval:2e3})}function P2(){const e=Ke(),n=Qc({select:o=>o.location.pathname}),s=e.data?.ready?e.data:null,r=C.useMemo(()=>(s?.tickets??[]).filter(Xo).map(o=>({key:o.id,since:Bk(o),ticket:o})),[s]),i=Vu();return nw(s?.meta.project,r.length+i.length),aw(),n.startsWith("/inbox")?null:t.jsx(sw,{items:r,breakdowns:i})}function BI(){const e=tw(),n=C.useMemo(()=>(e.data?.items??[]).map(({project:r,ticket:i})=>({key:`${r.id}/${i.id}`,since:Bk(i),ticket:i,project:r})),[e.data]),s=Zb();return nw("squad-kit",n.length+s.length),aw(),t.jsx(sw,{items:n,breakdowns:s,home:!0})}function nw(e,n){C.useEffect(()=>{e&&(document.title=u7(e,n))},[e,n])}function WI(e){const[n,s]=C.useState(Date.now);return C.useEffect(()=>{const r=setInterval(()=>s(Date.now()),e);return()=>clearInterval(r)},[e]),n}function sw({items:e,home:n,breakdowns:s=[]}){const[r]=C.useState(()=>new h7),i=WI(3e4),o=C.useMemo(()=>r.sort(e),[r,e]),l=o.length+s.length;if(!l)return null;const u=o.slice(0,2),d=s.slice(0,2-u.length),p=l-u.length-d.length,f=l===1?"1 thing needs you":`${l} things need you`,m=x=>p>0&&(n?t.jsxs("button",{className:`ymore ${x}`,onClick:()=>document.getElementById("waiting")?.scrollIntoView({behavior:"smooth",block:"start"}),children:["and ",p," more"]}):t.jsxs(Ce,{to:"/inbox",className:`ymore ${x}`,children:["and ",p," more"]}));return t.jsxs("section",{className:"ybar","aria-label":"Waiting for you",children:[t.jsx("span",{className:"ybar-n","aria-hidden":!0,children:l}),t.jsx("b",{className:"ybar-t","aria-live":"polite",title:n?"The squads keep working on everything else meanwhile.":"The squad keeps working on everything else meanwhile.",children:f}),t.jsxs("div",{className:"ybar-items",children:[u.map(x=>t.jsx(UI,{it:x,now:i},x.key)),d.map(x=>t.jsx(DI,{w:x},`${x.project?.id??""}/${x.id}`))]}),m("ymore-row"),t.jsx(YI,{})]})}function UI({it:e,now:n}){const s=e.ticket,r=qs(s)?si(s):void 0,i=s.waiting?.summary??(r?`Change ${r.id} to the spec waits for you`:bs(s)?mm(s):s.outdated?.length?hm(s):`Looks stuck: ${s.quiet?.detail??"no progress"}`),o=s.waiting?au(s):r?"Check the change":"Check it",l=s.waiting?.kind==="ask"&&s.agentQuestion?`“${s.agentQuestion.text}”`:s.title,u=[e.project?.name,s.id,_s[s.stage],d7(e.since,n)].filter(Boolean).join(" · ");return t.jsxs("div",{className:"yitem",title:`${u}
645
+ ${i}
646
+ ${l}`,children:[t.jsx("span",{className:"yid",children:e.project?`${e.project.name} · ${s.id}`:s.id}),Xm(s)?t.jsxs("span",{className:"yline",...De(s.title),children:[t.jsx(ew,{t:s}),t.jsx(D,{text:s.title})]}):t.jsx(D,{className:"yline",text:i}),e.project?t.jsx("a",{className:"btn sm you",href:Uk(e.project.id,s),children:o}):s.waiting?.kind==="proof"?t.jsx(Ce,{to:"/tickets/$id/proof",params:{id:s.id},className:"btn sm you",children:o}):t.jsx(Ce,{to:"/board",search:{ticket:s.id},className:"btn sm you",children:o})]})}const rw="sk.notices";function Io(){try{return window.localStorage}catch{return null}}function t1(){const e=Io()?.getItem(rw);return e==="on"||e==="off"?e:null}function n1(){return typeof Notification>"u"?window.isSecureContext===!1?"insecure":"none":window.isSecureContext===!1?"insecure":Notification.permission}let s1=!1;function R2(e){s1=e,iw()}const Tf=new Set,iw=()=>Tf.forEach(e=>e());function HI(e){return Tf.add(e),window.addEventListener("storage",e),window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{Tf.delete(e),window.removeEventListener("storage",e),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}}const VI=()=>`${t1()??""}|${n1()}|${s1?"asking":""}`;function $p(e){try{Io()?.setItem(rw,e)}catch{}iw()}function KI(){try{new Notification("Desktop notices are on",{body:"squad-kit shows one like this for each new thing that needs you.",tag:"sk-notices-on",silent:!0})}catch{}}function r1(){const{toast:e}=Le(),[n,s,r]=C.useSyncExternalStore(HI,VI).split("|"),i=n||null;return{choice:i,permission:s,asking:r==="asking",on:i==="on"&&s==="granted",canAsk:i===null&&(s==="default"||s==="granted"),turnOn:async()=>{if(s1)return;R2(!0);let l="error";try{l=await b7(typeof Notification>"u"?void 0:Notification,{secure:window.isSecureContext!==!1})}finally{R2(!1)}const u=w7(l);u.choice&&$p(u.choice),u.test&&KI(),e(u.say,u.bad?"err":void 0)},turnOff:()=>{$p("off"),e("Desktop notices are off")},notNow:()=>{$p("off"),e("No desktop notices. Turn them on in Settings any time.")}}}function YI(){const e=r1();return!e.canAsk&&!e.asking?null:t.jsxs("div",{className:"ybar-ask","aria-live":"polite",title:e.asking?Hk:"Get a desktop notice when the squad needs you",children:[t.jsx(Zp,{size:14}),t.jsx("button",{className:"linkbtn",disabled:e.asking,onClick:()=>void e.turnOn(),children:e.asking?"Waiting for your browser…":"Desktop notices"}),!e.asking&&t.jsx("button",{className:"linkbtn quiet",onClick:e.notNow,"aria-label":"No desktop notices",children:"Not now"})]})}function GI(){const e=r1();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Desktop notices"}),t.jsx("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:e.permission==="none"?t.jsx("span",{className:"note",children:"This browser can't show desktop notices. The banner and the tab title still show what needs you."}):e.permission==="insecure"?t.jsx("span",{className:"note",children:"Your browser shows desktop notices only on a secure page. Open the board on this computer, at its 127.0.0.1 or localhost address, to turn them on."}):e.permission==="denied"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"pill you",children:"Blocked by your browser"}),t.jsx("span",{className:"note",children:ao})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn sm",disabled:e.asking,onClick:()=>e.on?e.turnOff():void e.turnOn(),children:e.asking?"Waiting for your browser…":e.on?"On: turn them off":"Off: turn them on"}),t.jsx("span",{className:"note","aria-live":"polite",children:e.asking?Hk:e.choice==="on"&&e.permission==="default"?`You turned them on, but your browser has not allowed them yet. ${ao}`:"A notice for each new question, approval, proof and failure, in this browser. No sounds."})]})})]})}const QI=new y7;function aw(){XI();const e=tw(),n=Gt(),s=e.data;C.useEffect(()=>{if(!s)return;const r=QI.next(x7(s.items),Date.now());if(!r.length||t1()!=="on"||n1()!=="granted")return;const i=o=>{if(o.project.id!==wt)return window.location.assign(Uk(o.project.id,o.ticket));if(o.ticket.waiting?.kind==="proof")return void n({to:"/tickets/$id/proof",params:{id:o.ticket.id}});n({to:"/board",search:{ticket:o.ticket.id}})};for(const o of r)Wk(o.key,Date.now(),Io())&&ZI(o,i)},[s,n])}function ZI(e,n){const{title:s,body:r}=k7(e);ow(s,r,e.key,()=>n(e))}function ow(e,n,s,r){try{const i=new Notification(e,{body:n,tag:s,silent:!0});i.onclick=()=>{window.focus(),i.close(),r()}}catch{}}function XI(){const e=Co(Io()).length>0,s=$e({queryKey:["app","projects"],queryFn:()=>Se("/api/v1/app/projects"),refetchInterval:2e3,enabled:e}).data;C.useEffect(()=>{if(!s)return;const r=Io();for(const i of T7(s.projects,Co(r))){if($7(r,i.id),t1()!=="on"||n1()!=="granted"||!Wk(`setup/${i.id}`,Date.now(),r))continue;const{title:o,body:l}=E7(i.name);ow(o,l,`setup/${i.id}`,()=>window.location.assign(`/p/${encodeURIComponent(i.id)}/overview`))}},[s])}function Fo(e=""){return $e({queryKey:["conversations",e],queryFn:()=>Se(`/api/v1/conversations${e?`?q=${encodeURIComponent(e)}`:""}`),refetchInterval:1500})}function i1(e,n){if(!e.open)return 0;const s=n[e.id];return s===void 0?e.fresh:Math.min(e.fresh,Math.max(0,e.count-s))}function JI(){const e=zu(),n=sa(ra),s=Fo();return!n&&!e.min&&(s.data??[]).some(r=>r.open)}function eF(e){const n=pt[e.with];return e.thinking?`The ${n} is typing on ${e.id}`:e.yourTurn?`The ${n} answered on ${e.id}`:`${n} on ${e.id}`}function tF(){const e=zu(),n=sa(ra),s=Gt(),r=Fo(),[i,o]=C.useState(null),l=C.useRef(null),u=(r.data??[]).filter(m=>m.open),d=u.find(m=>m.id===e.tab)??u[0];if(C.useEffect(()=>{l.current?.querySelector(".ctab.on")?.scrollIntoView({block:"nearest",inline:"nearest"})},[d?.id,e.min]),!d)return null;const p=m=>void s({to:"/conversations",search:{ticket:m}});if(e.min||n){const m=u.find(x=>x.thinking)??u.find(x=>x.yourTurn)??d;return t.jsxs("div",{className:"cmini",role:"status",children:[t.jsx(Dn,{role:m.with,small:!0,live:m.thinking}),t.jsxs("div",{children:[t.jsxs("b",{children:[u.length," ",u.length===1?"conversation":"conversations"]}),t.jsx("small",{children:eF(m)})]}),t.jsx("button",{className:"btn pri sm",onClick:()=>n?p(m.id):gs.restore(),children:"Open"})]})}const f=m=>{m.preventDefault();const x=m.clientX,y=e.width,j=b=>gs.resize(y+(x-b.clientX)),k=()=>{window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",k),document.body.classList.remove("cresizing")};document.body.classList.add("cresizing"),window.addEventListener("mousemove",j),window.addEventListener("mouseup",k)};return t.jsxs(t.Fragment,{children:[i&&t.jsx(Wm,{doc:i,onClose:()=>o(null)}),t.jsxs("section",{className:"cdock",style:{width:e.width},"aria-label":"Conversations",children:[t.jsx("span",{className:"cgrip",onMouseDown:f,"aria-hidden":"true"}),t.jsxs("div",{className:"ctabs",children:[t.jsx("div",{className:"ctabscroll",role:"tablist","aria-label":"Open conversations",ref:l,children:u.map(m=>{const x=m.id===d.id,y=i1(m,e.seen);return t.jsxs("button",{className:`ctab ${x?"on":""}`,role:"tab","aria-selected":x,onClick:()=>gs.pick(m.id),title:`${m.id} · ${m.title}`,children:[t.jsx(Dn,{role:m.with,small:!0}),t.jsx("span",{className:"tid",children:m.id}),t.jsx("span",{className:"tn",children:pt[m.with]}),m.thinking&&!x&&t.jsxs("span",{className:`cdots sm c-${m.with}`,"aria-label":"Typing",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),y>0&&!x&&t.jsx("span",{className:"cbadge","aria-label":`${y} unread`,children:y})]},m.id)})}),t.jsx(lw,{}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn",onClick:()=>p(d.id),"aria-label":"Open full screen",title:"Full screen",children:t.jsx(Au,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:gs.minimize,"aria-label":"Minimize",title:"Minimize",children:t.jsx(Vo,{size:16})})]}),t.jsx(Zm,{id:d.id,size:"panel",onOpenDoc:o},d.id)]})]})}function lw(){const e=Ke(),n=pe(),[s,r]=C.useState(!1),[i,o]=C.useState(""),[l,u]=C.useState("analyst"),d=(e.data?.ready?e.data.tickets:[]).filter(f=>!f.chat?.open&&!f.takenOver),p=()=>n.mutate({path:`/api/v1/tickets/${i}/chat/start`,body:{with:l}},{onSuccess:()=>{r(!1),gs.show(i)}});return t.jsxs("span",{className:"cmenu-w",children:[t.jsx("button",{className:"iconbtn",onClick:()=>r(!s),"aria-label":"Start a new conversation",title:"Start a new conversation","aria-expanded":s,children:t.jsx(Nt,{size:16})}),s&&t.jsxs("div",{className:"cmenu cnew",role:"dialog","aria-label":"Start a new conversation",children:[t.jsxs("label",{children:[t.jsx("span",{children:"Ticket"}),t.jsxs("select",{className:"input",value:i,onChange:f=>o(f.target.value),children:[t.jsx("option",{value:"",children:"Pick a ticket"}),d.map(f=>t.jsxs("option",{value:f.id,children:[f.id," · ",as(f.title)]},f.id))]})]}),t.jsxs("label",{children:[t.jsx("span",{children:"Talk to"}),t.jsx("select",{className:"input",value:l,onChange:f=>u(f.target.value),children:Object.keys(pt).map(f=>t.jsxs("option",{value:f,children:["The ",pt[f]]},f))})]}),t.jsxs("div",{className:"cbtns",children:[t.jsx("button",{className:"btn pri sm",disabled:!i||n.isPending,onClick:p,children:"Start talking"}),t.jsx("button",{className:"btn sm",onClick:()=>r(!1),children:"Cancel"})]})]})]})}const cw=["app","usage-limit"];function uw(){return $e({queryKey:cw,queryFn:()=>Se("/api/v1/app/usage-limit"),refetchInterval:5e3})}function Ef(){const{data:e}=uw(),n=Hn(),{toast:s}=Le();if(!e?.pause||!e.text)return null;const r=async()=>{try{n.setQueryData(cw,await at("/api/v1/app/usage-limit/try-now","POST")),n.invalidateQueries(),s("The squad carries on now. If the limit is still there, it waits again by itself.")}catch(i){s(i instanceof Error?i.message:String(i),"err")}};return t.jsxs("section",{className:"upd failed",role:"status","aria-label":"The usage limit is reached",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(ef,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:e.text}),t.jsxs("span",{className:"upd-sub",children:["Every project waits, because they share one ",e.pause.name," account. Nothing is lost, and the wait does not count as a failed try.",e.pause.resetsAt?"":" squad-kit looks again every 10 minutes."]})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsx("button",{className:"btn sm",onClick:()=>void r(),children:"Try now"}),t.jsx(re,{text:"squad try-now"})]})]})}function Af(){const{data:e}=$e({queryKey:["app","save-trouble"],queryFn:()=>Se("/api/v1/app/save-trouble"),refetchInterval:5e3});return e?.text?t.jsxs("section",{className:"upd failed",role:"alert","aria-label":"squad-kit cannot save its work",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(t8,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:e.text}),t.jsxs("span",{className:"upd-sub",children:["The squad waits meanwhile. ",e.projects.length>1?`${e.projects.length} projects wait.`:""]}),e.detail&&t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("span",{className:"mono",style:{fontSize:12.5,whiteSpace:"pre-wrap"},children:e.detail})]})]})]}):null}function dw(e){return $e({queryKey:["happened",e.id],queryFn:()=>Se(`/api/v1/tickets/${e.id}/happened`),refetchInterval:e.live?5e3:15e3})}function Ku(e){const n=Math.max(0,Math.round(e));if(n<60)return`${Math.max(1,n)} s`;if(n<600)return n%60?`${Math.floor(n/60)} min ${n%60} s`:`${n/60} min`;if(n<3600)return`${Math.round(n/60)} min`;const s=Math.round(n%3600/60);return s?`${Math.floor(n/3600)} h ${s} min`:`${Math.floor(n/3600)} h`}function nF({t:e,onTab:n,onLog:s}){const r=dw(e);return r.data?r.data.steps.length?t.jsxs("div",{className:"happened",children:[r.data.steps.map((i,o)=>t.jsx(sF,{s:i,t:e,onTab:n,onLog:s},`${i.step}-${i.from??i.to??o}`)),t.jsx("p",{className:"note happened-foot",children:"Engineers: Full log shows every action the agents took, with commands, file changes and their exact words, and how to open each session in a terminal."})]}):t.jsx("p",{className:"note",children:"Nothing has happened yet. The first card comes when the first step ends, for example the Analyst's questions."}):t.jsx("p",{className:"note",children:r.isError?"Could not read what happened. It tries again by itself.":"Loading…"})}function sF({s:e,t:n,onTab:s,onLog:r}){const i=e.seconds!==void 0?Ku(e.seconds):"",o=[e.running?`now${i?` · ${i}`:""}`:i,...e.notes].filter(Boolean).join(" · ");return t.jsxs("article",{className:`hstep ${e.running?"now":""}`,"aria-label":e.name,children:[t.jsxs("div",{className:"hhd",children:[e.running?t.jsx("span",{className:"hring","aria-label":"Working now"}):t.jsx("span",{className:"hok","aria-label":"Done",children:t.jsx(ge,{size:11,strokeWidth:3})}),t.jsx("b",{children:e.name}),o&&t.jsx("span",{children:o}),t.jsx("span",{className:"grow"}),e.to&&!e.running&&t.jsx("span",{className:"hat",children:Wn(e.to)})]}),t.jsx(D,{as:"p",className:"hsum",text:e.summary}),e.handedIn&&t.jsx(iF,{h:e.handedIn,tab:e.tab,onTab:s,ticket:n}),e.session&&(e.actions??0)>0&&t.jsxs("button",{className:"linkbtn hmore",onClick:()=>r(e.session),children:["What it looked at and said (",e.actions," ",e.actions===1?"action":"actions",")"]}),e.skipped?t.jsxs("div",{className:"hskip",children:[t.jsx(Vo,{size:12})," Skipped ",e.skipped===1?"one action":`${e.skipped} actions`," this step may not take (by design, nothing went wrong)"]}):null]})}const rF={plan:"Open it in Plan",changes:"See the changes",proof:"Open it in Proof"};function a1(e,n=3){const[s,r]=C.useState(!1),i=e.length-n;return{shown:s?e:e.slice(0,n),more:i>0?t.jsx("button",{className:"linkbtn",onClick:()=>r(!s),children:s?"Show less":`+${i} more`}):null}}function iF({h:e,tab:n,onTab:s,ticket:r}){if(e.kind==="verdict")return t.jsx("div",{className:"hverdict",children:t.jsx(I2,{h:e,ticket:r})});const i=n&&s?t.jsx("button",{className:"linkbtn",onClick:()=>s(n),children:e.kind==="checks"?"See them in Proof":rF[n]}):null;return t.jsxs("div",{className:"hgot",children:[t.jsx("b",{children:"Handed in"}),t.jsx(I2,{h:e,ticket:r}),i&&t.jsx("div",{className:"hlink",children:i})]})}function I2({h:e,ticket:n}){switch(e.kind){case"questions":return t.jsx(aF,{items:e.items});case"spec":return t.jsx(oF,{story:e.story,criteria:e.criteria});case"design":return t.jsx(lF,{h:e});case"files":return t.jsx(cF,{h:e});case"checks":return t.jsxs("span",{children:[t.jsx("span",{className:`pill ${e.ok?"ok":"bug"}`,children:e.ok?"Pass":"Failed"})," ",t.jsx(D,{text:e.text})]});case"verdict":return t.jsxs("span",{children:[t.jsx("span",{className:`pill ${e.approved?"ok":"you"}`,children:e.approved?"Approved":"Asked for fixes"}),e.notes.length>0&&t.jsx("ul",{className:"hlist",children:e.notes.map((s,r)=>t.jsx(D,{as:"li",text:s},r))})]});case"shots":return t.jsx(uF,{shots:e.shots,ticket:n})}}function aF({items:e}){const{shown:n,more:s}=a1(e);return t.jsxs(t.Fragment,{children:[t.jsx("ol",{className:"hlist",children:n.map((r,i)=>t.jsxs("li",{...De(r.text),children:[t.jsx(D,{text:r.text}),r.answer&&t.jsx(D,{className:"hans",lead:"You:",text:r.answer})]},i))}),s]})}function oF({story:e,criteria:n}){const{shown:s,more:r}=a1(n);return t.jsxs(t.Fragment,{children:[e&&t.jsx(D,{as:"p",className:"hstory",text:e}),n.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"hsub",children:"Done when"}),t.jsx("ul",{className:"hlist",children:s.map((i,o)=>t.jsx(D,{as:"li",text:i},o))}),r]})]})}function lF({h:e}){const{shown:n,more:s}=a1(e.steps),r=[e.mockup?"With a mockup":"",e.follows.length?`Follows ${e.follows.join(", ")}`:"",e.adr?`Saved as ${e.adr}`:""].filter(Boolean);return t.jsxs(t.Fragment,{children:[e.title&&t.jsxs("p",{className:"hstory",...De(e.title),children:[t.jsx(D,{as:"b",text:e.title}),e.chosen?t.jsx(D,{text:`: ${e.chosen}`}):""]}),e.steps.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"hsub",children:[e.steps.length," ",e.steps.length===1?"step":"steps"," to build"]}),t.jsx("ol",{className:"hlist",children:n.map((i,o)=>t.jsx(D,{as:"li",text:i},o))}),s]}),r.length>0&&t.jsx("span",{className:"hsub",children:r.join(" · ")})]})}function cF({h:e}){const n=[["New",e.added],["Changed",e.changed],["Removed",e.removed]].filter(([,s])=>s.length);return n.length?t.jsx("span",{className:"hfiles",children:n.map(([s,r])=>t.jsxs("span",{children:[s,": ",t.jsx("span",{className:"mono",children:r.slice(0,8).join(", ")}),r.length>8?` and ${r.length-8} more`:""]},s))}):t.jsx("ol",{className:"hlist",children:e.steps.map((s,r)=>t.jsx(D,{as:"li",text:s},r))})}function uF({shots:e,ticket:n}){const[s,r]=C.useState(null),i=e.map(o=>({src:ss(`/api/v1/proof/${o.file}`),caption:o.criterion}));return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hshots",children:i.map((o,l)=>t.jsxs("button",{className:"zoom",onClick:()=>r(l),"aria-label":`Open the screenshot for ${o.caption} full size`,children:[t.jsx("img",{src:o.src,alt:`${n.id}: ${o.caption}`,loading:"lazy"}),t.jsx(D,{as:"small",text:o.caption})]},o.src))}),s!==null&&t.jsx(oi,{pictures:i,start:s,onClose:()=>r(null)})]})}const dF={questions:"Questions",spec:"Spec",scan:"Reading the project",design:"Design",blueprint:"Stack and patterns",build:"Build",fix:"Fixes",review:"Review",proof:"Proof",chat:"Talking it through",draft:"Filling in a new ticket"},hF=["analyst","architect","builder","reviewer","tester"];function o1(e){return e?.payment==="api-key"?"What the work cost on your API key, at its prices.":`What the work would cost at API prices. Your ${e?.name??"AI"} plan covers it, so this is a value, not a bill.`}function hw(e,n){e.runs+=n.runs;for(const s of["inputTokens","cachedTokens","outputTokens","costUsd"])n[s]!==void 0&&(e[s]=(e[s]??0)+n[s]);n.tokensUnknown&&(e.tokensUnknown=(e.tokensUnknown??0)+n.tokensUnknown),n.costUnknown&&(e.costUnknown=(e.costUnknown??0)+n.costUnknown)}function l1(e){const n={runs:0};for(const s of e)hw(n,s);return n}function pw(e){return hF.flatMap(n=>{const s=e.filter(i=>i.role===n);if(!s.length)return[];const r=[];for(const i of s){let o=r.find(l=>l.level===i.level&&l.model===i.model);o||r.push(o={level:i.level,model:i.model,steps:[],total:{runs:0}}),o.steps.includes(i.step)||o.steps.push(i.step),hw(o.total,i)}return[{role:n,total:l1(s),levels:r}]})}function Xi(e){return e.costUsd===void 0?null:e.costUsd<.005?"under $0.01":`$${e.costUsd.toFixed(2)}`}function Ec(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}const Pf=e=>`${e} ${e===1?"run":"runs"}`;function F2({t:e}){const n=Xi(e);return n?t.jsxs("span",{title:e.costUnknown?`${Pf(e.costUnknown)} did not report a cost, so the real amount is higher`:void 0,children:[n,e.costUnknown?t.jsxs("span",{className:"note",children:[" +",e.costUnknown," not reported"]}):null]}):t.jsx("span",{className:"note",children:"Not reported"})}function z2({t:e}){if(e.inputTokens===void 0&&e.outputTokens===void 0)return t.jsx("span",{className:"note",children:"Not reported"});const n=e.cachedTokens?`, ${Ec(e.cachedTokens)} of it read again from earlier in the conversation, which costs less`:"";return t.jsxs("span",{title:`Tokens are the pieces of text the AI reads and writes. It read ${Ec(e.inputTokens??0)}${n}.`,children:[e.inputTokens!==void 0&&t.jsxs(t.Fragment,{children:[Ec(e.inputTokens)," read"]}),e.inputTokens!==void 0&&e.outputTokens!==void 0&&" · ",e.outputTokens!==void 0&&t.jsxs(t.Fragment,{children:[Ec(e.outputTokens)," written"]})]})}function pF({level:e,model:n}){return n?t.jsxs(t.Fragment,{children:[n," ",t.jsx("span",{className:"note",children:e})]}):t.jsx(t.Fragment,{children:e})}function c1({roles:e,total:n,steps:s}){return t.jsxs("table",{className:"table usage",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Role"}),t.jsx("th",{children:"Model level"}),t.jsx("th",{children:s?"What it did":"Runs"}),t.jsx("th",{children:"Tokens"}),t.jsx("th",{className:"num",children:"Cost"})]})}),t.jsx("tbody",{children:e.flatMap(r=>r.levels.map((i,o)=>t.jsxs("tr",{children:[t.jsx("td",{children:o===0&&t.jsxs("span",{className:"who",children:[t.jsx(ni,{role:r.role,small:!0})," ",Ms[r.role]]})}),t.jsx("td",{children:t.jsx(pF,{level:i.level,model:i.model})}),t.jsx("td",{children:s?t.jsxs(t.Fragment,{children:[i.steps.map(l=>dF[l]??l).join(", "),t.jsxs("span",{className:"note",children:[" · ",Pf(i.total.runs)]})]}):i.total.runs}),t.jsx("td",{children:t.jsx(z2,{t:i.total})}),t.jsx("td",{className:"num",children:t.jsx(F2,{t:i.total})})]},`${r.role}-${i.level}-${i.model}`)))}),t.jsx("tfoot",{children:t.jsxs("tr",{children:[t.jsx("td",{children:"Total"}),t.jsx("td",{}),t.jsx("td",{children:s?t.jsx("span",{className:"note",children:Pf(n.runs)}):n.runs}),t.jsx("td",{children:t.jsx(z2,{t:n})}),t.jsx("td",{className:"num",children:t.jsx(F2,{t:n})})]})})]})}function ca(){return $e({queryKey:["cost"],queryFn:()=>Se("/api/v1/cost"),refetchInterval:1e4})}function fF({t:e}){const n=ca().data?.payment,s=e.usage??[],r=l1(s),i=Xi(r);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["What it used",s.length>0&&t.jsx("span",{className:"pill",children:i?n?.payment==="api-key"?`${i} on your API key`:`Included in your plan · ${i} value`:"Cost not reported"})]}),s.length?t.jsxs(t.Fragment,{children:[t.jsx(c1,{roles:pw(s),total:r,steps:!0}),t.jsxs("p",{className:"note",style:{marginTop:8},children:[o1(n)," Each role's model level can be changed on the Harness page, under Agents."]})]}):t.jsx("p",{className:"note",children:"Nothing yet. Each run of a role is counted here as the squad works."})]})}function fw(){return $e({queryKey:["usage"],queryFn:()=>Se("/api/v1/usage"),refetchInterval:5e3})}function mF(){const e=fw().data?.total,n=ca().data?.payment;return e?.runs?t.jsx("span",{title:o1(n),children:n?.payment==="api-key"?t.jsxs(t.Fragment,{children:["Used ",t.jsx("b",{children:Xi(e)??"an unknown amount"})," on your API key"]}):t.jsxs(t.Fragment,{children:[t.jsx("b",{children:Xi(e)??"An unknown amount"})," of AI work, included in your plan"]})}):null}function gF(){const e=fw().data,n=ca().data?.payment;return e?.total.runs?t.jsxs(t.Fragment,{children:[t.jsx("h2",{style:{marginTop:30},children:"What the squad used"}),t.jsxs("p",{className:"note",style:{marginTop:2},children:["Every ticket on this computer (",e.tickets," so far) and the project's own work, like reading the project and filling in new tickets",e.project.runs?` (${Xi(e.project)??"cost not reported"})`:"",e.deleted?.tickets?`, and ${e.deleted.tickets} deleted ${e.deleted.tickets===1?"ticket":"tickets"} (${Xi(e.deleted.total)??"cost not reported"})`:"",". ",o1(n)," Change a role's model level with its Edit button above."]}),t.jsx("div",{style:{marginTop:10},children:t.jsx(c1,{roles:e.roles,total:e.total})})]}):null}const ts=e=>e<.005?"under $0.01":`$${e.toFixed(2)}`,zo=e=>e>0&&e<.01?"under 1%":`${Math.round(e*100)}%`;function xF({t:e}){const n=$e({queryKey:["cost",e.id],queryFn:()=>Se(`/api/v1/tickets/${e.id}/cost`),refetchInterval:e.live?5e3:2e4}),s=n.data;return s?s.total.runs?t.jsxs("div",{className:"costs",children:[t.jsx(L2,{c:s}),t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Size of the work"}),s.size?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sizes",role:"img","aria-label":`Size: ${s.size.size}`,children:["small","medium","large"].map(r=>t.jsx("span",{className:r===s.size.size?"on":"",children:r[0].toUpperCase()+r.slice(1)},r))}),t.jsxs("p",{children:[s.size.words," ",s.why]})]}):t.jsxs("p",{children:["This is one of the first tickets in ",s.project,", so there is no usual size to compare with yet. It shows once two tickets are accepted.",s.why?` ${s.why}`:""]}),s.seconds!==void 0&&t.jsxs("p",{className:"note",children:["The squad worked on it for ",Ku(s.seconds),", not counting the time it waited for you."]})]}),s.where.parts.length>0&&t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Where the work went"}),t.jsx("div",{className:"wbars",children:s.where.parts.map(r=>t.jsxs("div",{className:"wbar",children:[t.jsx("span",{children:r.name}),t.jsxs("span",{className:"wbarline",children:[t.jsx("i",{style:{width:`${Math.max(2,Math.round(r.share*100))}%`}}),t.jsxs("small",{children:[zo(r.share),s.payment.payment==="api-key"&&r.costUsd!==void 0?` · ${ts(r.costUsd)}`:""]})]})]},r.name))}),t.jsxs("p",{className:"note",children:[s.where.by==="tokens"?"By the amount of text the AI read and wrote, because some steps did not report a cost. ":"","Thinking steps use the strongest model on purpose: a mistake there costs the most to fix later."]})]}),s.payment.payment==="subscription"?t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Value of the AI work"}),t.jsxs("p",{children:[s.total.costUsd!==void 0?t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"bigusd",children:ts(s.total.costUsd)})," at API prices, covered by your plan."]}):"The AI tool did not report what this work is worth."," ","This month the squad did ",t.jsx("b",{children:ts(s.month.total.costUsd??0)})," of AI work for ",s.project,"."]}),t.jsxs("p",{className:"note",children:["This is a value, not a bill: what the same work would cost if you paid per use.",s.total.costUnknown?` ${s.total.costUnknown} of its steps did not report one.`:""]})]}):null,s.tip&&t.jsxs("section",{className:"costcard tip",children:[t.jsx("h3",{children:"Small change next time?"}),t.jsxs("p",{children:[s.tip,s.payment.payment==="subscription"?" If your plan's usage limit is reached, squad-kit pauses and carries on by itself when it resets.":""]})]}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:[s.details.models,s.details.tokens?`. ${s.details.tokens}.`:"."]}),t.jsx(c1,{roles:pw(e.usage??[]),total:l1(e.usage??[]),steps:!0}),t.jsx("div",{style:{marginTop:8},children:t.jsx(re,{text:`squad cost ${e.id}`})})]})]}):t.jsxs("div",{className:"costs",children:[t.jsx(L2,{c:s}),t.jsx("p",{className:"note",children:"Nothing used yet. Each step the squad takes is counted here."})]}):t.jsx("p",{className:"note",children:n.isError?"Could not read the cost. It tries again by itself.":"Loading…"})}function L2({c:e}){if(e.payment.payment==="subscription")return t.jsxs("section",{className:"costcard paid",children:[t.jsxs("div",{className:"paidhead",children:[t.jsx("span",{className:"paidic",children:t.jsx(ge,{size:15,strokeWidth:2.6})}),t.jsxs("b",{children:["Included in your ",e.payment.name," plan. No extra charge."]})]}),t.jsxs("p",{className:"muted",children:["You pay for ",e.payment.name," with a subscription, so this ticket cost you nothing extra."," ",e.payment.from==="guess"&&"squad-kit could not tell how you pay, so it shows it this way. ",t.jsx(Ce,{to:"/settings",children:"Pay with an API key instead?"})]})]});const n=e.budget;return t.jsxs("section",{className:`costcard ${n?.over.length?"over":n?.warn.length?"warn":""}`,children:[t.jsxs("div",{className:"paidhead",children:[t.jsx("span",{className:"paidic money",children:t.jsx(yk,{size:15})}),t.jsxs("b",{children:[e.total.runs?e.total.costUsd!==void 0?ts(e.total.costUsd):"Not reported":"$0.00"," on your API key",e.total.costUnknown?t.jsxs("span",{className:"note",children:[" + ",e.total.costUnknown," steps not reported"]}):null]})]}),t.jsxs("p",{className:"muted",children:["Real money: each step is paid per use",e.payment.found?.kind==="api-key"?`, on your ${e.payment.found.label}`:"",". ",t.jsx(Ce,{to:"/settings",children:"Pay with a subscription instead?"})]}),n&&t.jsx(yF,{b:n,project:e.project})]})}function M2({share:e}){return t.jsx("span",{className:`meter ${e>=1?"over":e>=.8?"warn":""}`,role:"img","aria-label":zo(e),children:t.jsx("i",{style:{width:`${Math.min(100,Math.round(e*100))}%`}})})}function yF({b:e,project:n}){return!e.ticketUsd&&!e.monthUsd?t.jsxs("p",{className:"note",children:["This month: ",ts(e.monthSpent)," for ",n,". No budget yet: ",t.jsx(Ce,{to:"/settings",children:"set one per ticket and per month"}),", and squad-kit warns you at 80%."]}):t.jsxs("div",{className:"budgets",children:[e.ticketUsd&&e.ticketShare!==void 0&&t.jsxs("div",{className:"budgetrow",children:[t.jsxs("span",{children:[zo(e.ticketShare)," of this ticket's ",ts(e.ticketUsd)," budget"]}),t.jsx(M2,{share:e.ticketShare})]}),e.monthUsd&&e.monthShare!==void 0&&t.jsxs("div",{className:"budgetrow",children:[t.jsxs("span",{children:["This month: ",ts(e.monthSpent)," of your ",ts(e.monthUsd)," for ",n]}),t.jsx(M2,{share:e.monthShare})]}),[...e.over,...e.warn].map(s=>t.jsxs("p",{className:"budgetsay",children:[t.jsx(kr,{size:14}),e.over.includes(s)?s==="ticket"?"Over its budget. Before its next step the ticket waits for you: carry on, do the rest yourself, or make the plan smaller. No step is cut in half.":"Over this month's budget. Each ticket waits for you before its next step. No step is cut in half.":s==="ticket"?"At 80% of its budget. At 100% the ticket waits for you before its next step.":"At 80% of this month's budget. At 100% tickets wait for you before their next step."]},s))]})}function jF(){const e=ca().data,[n,s]=C.useState(()=>{try{return JSON.parse(sessionStorage.getItem("squad-budget-hidden")??"[]")}catch{return[]}});if(C.useEffect(()=>{try{sessionStorage.setItem("squad-budget-hidden",JSON.stringify(n))}catch{}},[n]),!e||e.payment.payment!=="api-key")return null;const r=u=>`${u.kind}:${u.id??e.month.month}:${u.over?"over":"warn"}`,i=e.warnings.filter(u=>!n.includes(r(u)));if(!i.length)return null;const o=i[0],l=u=>u.kind==="month"?`This month the squad used ${zo(u.share)} of your ${ts(u.limit)} budget for ${e.project}${u.over?". Tickets wait for you before their next step":""}`:`${u.id} ${u.title} used ${zo(u.share)} of its ${ts(u.limit)} budget${u.over?". It waits for you before its next step":""}`;return t.jsxs("section",{className:"upd failed budgetbar",role:"status","aria-label":"Budget",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(yk,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx(D,{as:"b",className:"upd-title",text:l(o)}),t.jsxs("span",{className:"upd-sub",children:[i.length>1?`And ${i.length-1} more near a budget. `:"","At 100% a ticket waits for you between two steps, never in the middle of one."]})]}),t.jsxs("div",{className:"upd-acts",children:[o.id&&t.jsxs(Ce,{to:"/board",search:{ticket:o.id},className:"btn sm",children:["Open ",o.id]}),t.jsx(Ce,{to:"/settings",className:"btn sm",children:"Budgets"}),t.jsx("button",{className:"iconbtn","aria-label":"Hide this notice",onClick:()=>s([...n,...i.map(r)]),children:t.jsx(Qe,{size:14})})]})]})}function kF(){const e=ca().data,n=pe(),[s,r]=C.useState(""),[i,o]=C.useState(""),l=e?.budget;if(C.useEffect(()=>{r(l?.ticketUsd?String(l.ticketUsd):""),o(l?.monthUsd?String(l.monthUsd):"")},[l?.ticketUsd,l?.monthUsd]),!e)return null;const u=e.payment,d=(f,m)=>n.mutate({path:"/api/v1/cost/payment",method:"PUT",body:{payment:f},done:m}),p=u.found?`${u.tool} is signed in with ${u.found.label}${u.found.kind==="subscription"?", a subscription":", paid per use"}.`:`squad-kit could not tell how ${u.tool} is paid.`;return t.jsxs("div",{style:{margin:"22px 0 26px"},children:[t.jsx("h2",{children:"How you pay for the AI"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:[p," ",u.from==="you"?"You chose below, and your choice wins.":"Change it below if that is not right."," It decides what the Cost tab shows."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"You pay with"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${u.payment==="subscription"&&u.from==="you"?"pri":""}`,"aria-pressed":u.payment==="subscription"&&u.from==="you",onClick:()=>d("subscription","A subscription: the Cost tab shows the value of the work, with no extra charge"),children:"A subscription"}),t.jsx("button",{className:`btn sm ${u.payment==="api-key"&&u.from==="you"?"pri":""}`,"aria-pressed":u.payment==="api-key"&&u.from==="you",onClick:()=>d("api-key","An API key: the Cost tab shows real dollars and budgets"),children:"An API key"}),t.jsx("button",{className:`btn sm ${u.from!=="you"?"pri":""}`,"aria-pressed":u.from!=="you",onClick:()=>d("auto","squad-kit finds out how you pay"),children:"Find out for me"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad config set payment ${u.from==="you"?u.payment:"auto"}`})]})]}),u.payment==="api-key"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Budget per ticket"}),t.jsxs("span",{className:"moneyin",children:["$",t.jsx("input",{className:"input",inputMode:"decimal",value:s,placeholder:"No budget",onChange:f=>r(f.target.value),"aria-label":"Budget per ticket, in US dollars"})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Budget per month"}),t.jsxs("span",{className:"moneyin",children:["$",t.jsx("input",{className:"input",inputMode:"decimal",value:i,placeholder:"No budget",onChange:f=>o(f.target.value),"aria-label":"Budget per month, in US dollars"}),t.jsxs("span",{className:"note",children:["for ",e.project,", on this computer"]})]})]}),t.jsxs("div",{style:{marginTop:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn pri sm",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/cost/budget",method:"PUT",body:{ticketUsd:s.trim()||null,monthUsd:i.trim()||null},done:"Budgets saved"}),children:"Save budgets"}),t.jsx("span",{className:"note",children:"At 80% the ticket and the board say so. At 100% the ticket waits for you between two steps, never in the middle of one."}),t.jsx(re,{text:`squad config set budget --ticket ${s.trim()||"off"} --month ${i.trim()||"off"}`})]})]})]})}const vF={best:"Best",balanced:"Balanced",thrifty:"Thrifty"};function bF(){const e=ca().data;if(!e)return null;const n=e.quality.some(s=>s.tickets>0);return t.jsxs("div",{className:"maprow",children:[t.jsxs("b",{style:{paddingTop:2},children:["On ",e.project]}),t.jsxs("span",{className:"qstats",children:[!n&&t.jsxs("span",{className:"note",children:["Each Quality setting's average cost and time per accepted ticket shows here once ",e.qualityAfter," tickets are accepted with it."]}),n&&e.quality.map(s=>t.jsxs("span",{className:"qstat",children:[t.jsx("b",{children:vF[s.quality]}),s.tickets>=e.qualityAfter?t.jsxs("span",{children:[s.costUsd!==void 0?`${ts(s.costUsd)} ${e.payment.payment==="api-key"?"":"of AI work "}`:"",s.seconds!==void 0?`${s.costUsd!==void 0?"and ":""}${Ku(s.seconds)} of squad time `:"","per accepted ticket ",t.jsxs("span",{className:"note",children:["(",s.tickets," tickets)"]})]}):t.jsxs("span",{className:"note",children:["Shows after ",e.qualityAfter," accepted tickets (",s.tickets," so far)"]})]},s.quality)),n&&e.payment.payment==="subscription"&&t.jsx("span",{className:"note",children:"Values at API prices, covered by your plan."})]})]})}function wF(){const e=Pk(),n=e.data?.apps??[];if(!n.length)return null;const s=n.some(r=>r.start&&(r.state==="not-running"||r.state==="stopped")&&!r.up&&!r.fresh);return t.jsxs("div",{className:"apps",children:[t.jsx("div",{className:"apps-h",children:"Your apps"}),n.map(r=>t.jsx(TF,{a:r,together:n.filter(i=>i.start&&i.fresh&&i.fresh.id===r.fresh?.id),named:n.length>1,live:e.data?.live??!1,reading:e.data?.reading??!1,readError:e.data?.readError},r.repo)),s&&t.jsx("p",{className:"apps-note",children:"Starts the newest code, with every ticket you approved. No terminal needed."})]})}const NF=e=>(e??"").replace(/^https?:\/\//,"");function SF(e){const n=e.map(s=>`${s.id} ${s.title}`);return n.length>1?`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`:n[0]??""}function q2(e){switch(e.state){case"running":return $F(e.since);case"starting":return"Starting…";case"stopped":return"Stopped";case"failed":return"Failed";default:return"Not running"}}function CF(e){return e.step==="copy"?"Making a copy of the code. On a big project this takes a while.":e.step==="setup"?"Setting it up first":e.step==="start"?"Starting it":`Getting the newest ${e.base}`}function $F(e){const n=e?Math.round((Date.now()-Date.parse(e))/6e4):0;return n<1?"Running":`Running for ${n} min`}function TF({a:e,together:n,named:s,live:r,reading:i,readError:o}){const l=pe(),[u,d]=C.useState(!1),[p,f]=C.useState(!1),m=s?` ${na(e.name)}`:"",x=(b,S,N)=>l.mutate({path:`/api/v1/apps/${encodeURIComponent(e.name)}/${b}`,body:N,done:S}),y=b=>x("start",`Starting ${e.name}`,b),j=e.state==="failed"?e.busy:void 0,k=async(b,S,N)=>{try{for(const[$,A]of n.entries())await l.mutateAsync({path:`/api/v1/apps/${encodeURIComponent(A.name)}/${b}`,body:N,...$===n.length-1?{done:S}:{}})}catch{}};return t.jsxs("div",{className:`app-item ${e.state}`,children:[e.fresh&&e.start&&n[0]===e&&t.jsxs("div",{className:"app-new",role:"status",children:[t.jsxs("div",{className:"hd",children:[t.jsx("span",{className:"ok",children:t.jsx(ge,{size:13,strokeWidth:3})}),t.jsxs("b",{title:e.fresh.title,children:[e.fresh.id," is in the newest version"]})]}),t.jsx("p",{children:"Try the new version yourself."}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm go",disabled:l.isPending,onClick:()=>void k("restart",n.length>1?"Starting the new version":`Starting the new version of ${e.name}`),children:"Run the new version"}),t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>void k("not-now","Fine. It stays as it is.",{ticket:e.fresh.id}),children:"Not now"})]}),e.fresh.release&&t.jsxs("small",{children:["It also goes out in release ",e.fresh.release,"."]}),t.jsx(re,{text:`squad app restart${m}`})]}),t.jsxs("div",{className:"app-row",children:[t.jsx("i",{"aria-hidden":"true"}),t.jsxs("span",{className:"nm",children:[t.jsx("b",{children:e.name}),t.jsx("small",{title:e.state==="running"?`Running at ${e.address}`:q2(e),children:q2(e)})]}),e.state==="running"?t.jsx("a",{className:"btn sm pri",href:e.address,target:"_blank",rel:"noreferrer",title:`Open ${e.address}`,children:"Open"}):e.state==="starting"?t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>x("stop",`Stopped ${e.name}`),children:"Stop"}):e.start?t.jsx("button",{className:"btn sm go",disabled:l.isPending,onClick:()=>y(),children:e.state==="failed"?"Try again":"Start"}):null]}),e.state==="starting"&&t.jsx("p",{className:"app-more",children:CF(e)}),e.state==="running"&&t.jsxs("div",{className:"app-more",children:[t.jsx("span",{className:"addr",children:NF(e.address)}),e.includes.length>0&&t.jsx(D,{lead:"Includes",text:SF(e.includes)}),e.elsewhere&&t.jsx("span",{children:"Started outside the board, from a terminal or an earlier squad-kit."}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>x("restart",`Restarting ${e.name}`),children:"Restart"}),t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>x("stop",`Stopped ${e.name}`),children:"Stop"})]}),t.jsx(re,{text:`squad app stop${m}`})]}),e.state==="failed"&&!j&&t.jsx("p",{className:"app-more why",children:e.error}),e.state!=="running"&&e.state!=="starting"&&e.start&&!j&&t.jsx(re,{text:`squad app start${m}`}),e.state!=="running"&&e.state!=="starting"&&e.start&&e.up&&!j&&t.jsxs("p",{className:"app-more",children:["It looks like this app is already open on this computer."," ",t.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",children:"Open it"})]}),j&&t.jsxs("div",{className:"app-warn",children:[t.jsx("b",{children:e.error}),t.jsx("span",{children:j.ours?"squad-kit started it, so it can stop it for you.":"squad-kit leaves it alone. Close that program, then press Try again, or ask an engineer to look at what failed."}),j.ours&&t.jsx("div",{className:"app-acts",children:t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>y({stopOther:!0}),children:"Stop it and start"})}),t.jsx(re,{text:j.ours?`squad app start${m} --stop-other`:`squad app start${m}`})]}),!e.start&&!u&&t.jsxs("div",{className:"app-warn",children:[t.jsx("b",{children:"Start command unknown"}),t.jsx("span",{children:"squad-kit could not tell how to start this app yet."}),o&&!i&&t.jsxs("span",{className:"bad",children:["The Architect could not read the project: ",o]}),t.jsxs("div",{className:"app-acts",children:[r&&t.jsx("button",{className:"btn sm",disabled:i||l.isPending,onClick:()=>l.mutate({path:"/api/v1/scan",done:"The Architect is reading the project to find how to start it"}),children:i?"The Architect is looking…":"Ask the Architect to find it"}),t.jsx("button",{className:"btn sm",onClick:()=>d(!0),children:"Type it"})]}),!r&&t.jsx("span",{children:"You can also set it in Settings, under How the squad checks and runs this project."}),t.jsx(re,{text:r?"squad app find":`squad app set${m} --start "npm run dev"`})]}),u&&t.jsx(EF,{a:e,cmdRef:m,onDone:()=>d(!1)}),e.start&&t.jsx("button",{className:"app-link",onClick:()=>f(!0),children:e.state==="failed"?"See what failed":"Show output"}),p&&t.jsx(AF,{a:e,cmdRef:m,onClose:()=>f(!1),onChange:()=>{f(!1),d(!0)}})]})}function EF({a:e,cmdRef:n,onDone:s}){const r=pe(),[i,o]=C.useState(e.start??""),[l,u]=C.useState(e.url??""),d=()=>r.mutate({path:`/api/v1/apps/${encodeURIComponent(e.name)}/commands`,method:"PUT",body:{start:i,url:l},done:`Saved how ${e.name} starts`},{onSuccess:s});return t.jsxs("form",{className:"app-type",onSubmit:p=>{p.preventDefault(),d()},children:[t.jsxs("label",{children:["Start command",t.jsx("input",{className:"input",value:i,onChange:p=>o(p.target.value),placeholder:"npm run dev",autoFocus:!0,spellCheck:!1})]}),t.jsxs("label",{children:["Address",t.jsx("input",{className:"input",value:l,onChange:p=>u(p.target.value),placeholder:"http://localhost:3000",spellCheck:!1})]}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm pri",type:"submit",disabled:!i.trim()||r.isPending,children:"Save"}),t.jsx("button",{className:"btn sm",type:"button",onClick:s,children:"Cancel"})]}),t.jsx(re,{text:`squad app set${n} --start ${Me(i.trim()||"npm run dev")}${l.trim()?` --url ${na(l.trim())}`:""}`})]})}function AF({a:e,cmdRef:n,onClose:s,onChange:r}){const o=($e({queryKey:["apps",e.name,"output"],queryFn:()=>Se(`/api/v1/apps/${encodeURIComponent(e.name)}/output`),refetchInterval:2e3}).data?.lines??[]).join(`
647
+ `).trim();return t.jsxs(He,{title:e.state==="failed"?`${e.name}: what failed`:`${e.name}: how it starts`,wide:!0,onClose:s,footer:t.jsxs(t.Fragment,{children:[t.jsx(re,{text:`squad app start${n}`}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn sm",onClick:r,children:"Change"}),t.jsx("button",{className:"btn sm pri",onClick:s,children:"Done"})]}),children:[e.state==="failed"&&e.detail&&t.jsx("pre",{className:"app-out",style:{marginBottom:12},children:e.detail}),t.jsxs("div",{className:"app-how",children:[t.jsxs("div",{children:[t.jsx("span",{children:"Start command"}),t.jsx("code",{children:e.start})]}),t.jsxs("div",{children:[t.jsx("span",{children:"Address"}),t.jsx("code",{children:e.address??e.url??"The one it prints when it starts"})]}),e.setup&&t.jsxs("div",{children:[t.jsx("span",{children:"Setup, in a new copy and when its packages change"}),t.jsx("code",{children:e.setup})]}),t.jsxs("div",{children:[t.jsxs("span",{children:["squad-kit's copy of ",e.base]}),t.jsxs("code",{children:[e.dir,e.commit?` at ${e.commit.slice(0,8)}`:""]})]})]}),t.jsx("pre",{className:"app-out",children:o||"Nothing yet. Press Start, and what the app prints shows here."})]})}function PF({children:e}){const n=Qc({select:f=>f.location.pathname}),s=Qc({select:f=>f.location.search.ticket}),r=sa(ra),i=IF(),o=RF(n),l=n.startsWith("/board")&&!!s,[u,d]=C.useState(!1);C.useEffect(()=>d(!1),[s]);const p=l&&(r||i.is)&&o.length>0;return t.jsxs("div",{ref:i.ref,className:`banners ${p&&u?"unfolded":""}`,children:[p&&u&&t.jsxs("button",{className:"bless",onClick:()=>d(!1),"aria-expanded":!0,children:[t.jsx(ok,{size:14,"aria-hidden":!0})," Show less"]}),p&&!u&&t.jsxs("button",{className:"bslim",onClick:()=>d(!0),"aria-expanded":!1,"aria-label":`${o.map(f=>f.text).join(", ")}. Show the messages`,children:[t.jsx("span",{className:"bchips",children:o.map(f=>t.jsx("span",{className:`bchip ${f.tone}`,children:f.text},f.key))}),t.jsx(Jf,{size:16,"aria-hidden":!0})]}),t.jsx("div",{className:"banners-all",hidden:p&&!u,children:e})]})}function RF(e){const n=Iu().data,s=uw().data,r=Ke().data,i=[],o=n?V8(n):null;o&&i.push({key:"update",text:o,tone:n?.progress.state==="failed"?"you":"acc"}),s?.pause&&s.text&&i.push({key:"limit",text:"Usage limit",tone:"you"}),r?.ready&&r.console?.outdated&&i.push({key:"restart",text:"Restart to update",tone:"you"});const l=Vu().length,u=r?.ready&&!e.startsWith("/inbox")?r.tickets.filter(Xo).length+l:0;return u&&i.push({key:"waiting",text:`${u} need${u===1?"s":""} you`,tone:"you"}),i}function IF(){const[e,n]=C.useState(!1),s=C.useRef(null),r=C.useCallback(i=>{s.current?.disconnect(),!(!i||typeof ResizeObserver>"u")&&(s.current=new ResizeObserver(([o])=>n((o?.contentRect.width??1/0)<820)),s.current.observe(i))},[]);return C.useEffect(()=>()=>s.current?.disconnect(),[]),{ref:r,is:e}}function Yu(){return $e({queryKey:["setup"],queryFn:()=>Se("/api/v1/setup"),refetchInterval:e=>e.state.data?.setup&&!e.state.data.setup.ready&&!e.state.data.setup.approved?1e3:5e3})}function mw(e=1e3){const[n,s]=C.useState(Date.now);return C.useEffect(()=>{const r=setInterval(()=>s(Date.now()),e);return()=>clearInterval(r)},[e]),n}function FF({state:e}){return t.jsx("i",{className:`ob-mark ${e}`,"aria-hidden":!0,children:e==="done"?t.jsx(ge,{size:13,strokeWidth:3}):e==="failed"?"!":e==="skipped"?"–":e==="stopped"?t.jsx(is,{size:8,fill:"currentColor"}):e==="now"?t.jsx("span",{className:"live"}):null})}function zF({st:e,now:n}){const s=pe(),[r,i]=C.useState(!1),o=af(e,n);return t.jsxs("li",{className:`ob-step ${e.state}`,children:[t.jsx(FF,{state:e.state}),t.jsxs("span",{className:"ob-st-t",children:[t.jsx("b",{children:e.label}),e.note&&t.jsx("small",{title:e.note,children:e.note}),e.state==="now"&&t.jsx("span",{className:"setup-bar","aria-hidden":!0,children:t.jsx("i",{})}),e.error&&t.jsx("span",{className:"ob-err",children:e.error}),e.ways.length>0&&t.jsxs("span",{className:"ob-ways",children:[e.ways.map(l=>l.do==="again"?t.jsxs("span",{className:"ob-way",children:[t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/setup/again",body:{step:l.step},done:l.step==="read"?"The Architect reads the project again":"squad-kit tries it again"}),children:l.label}),t.jsx(re,{text:l.command})]},l.label):l.do==="output"?t.jsx("button",{className:"btn sm quiet",onClick:()=>i(!r),"aria-expanded":r,children:r?"Hide what failed":l.label},l.label):t.jsx(Ce,{to:"/settings",className:"btn sm quiet",children:l.label},l.label)),e.state==="failed"&&(e.id==="read"||e.id==="tool")&&t.jsx(Wu,{small:!0})]}),r&&e.output&&t.jsx("pre",{className:"ob-out",children:e.output})]}),t.jsxs("time",{className:"ob-time",children:[o,(e.state==="now"||e.state==="todo")&&t.jsx("small",{children:e.usual})]})]})}const LF=[{id:"best",name:"Best",note:"The strongest model builds and reviews. Uses your plan's limits faster."},{id:"balanced",name:"Balanced",note:"The strongest model at medium effort."},{id:"thrifty",name:"Thrifty",note:"A lighter model builds. Cheapest."}];function MF({s:e}){const n=pe(),[s,r]=C.useState(null);if(e.approved)return null;const i=s??e.quality;return t.jsxs("section",{className:"ob-quality","aria-label":"Quality",children:[t.jsxs("div",{className:"ob-q-h",children:[t.jsx("b",{children:"How strong should the squad be?"}),t.jsx("span",{className:"note",children:e.qualityAsked?"Saved. Change it any time in Settings.":"Asked once. You can change it any time in Settings."})]}),t.jsx("div",{className:"ob-q-opts",role:"radiogroup","aria-label":"Quality",children:LF.map(o=>t.jsxs("button",{role:"radio","aria-checked":o.id===i,className:`ob-q ${o.id===i?"on":""}`,onClick:()=>{r(o.id),n.mutate({path:"/api/v1/setup/quality",body:{quality:o.id},done:`Quality is ${o.name}. The squad uses it from its first step.`})},children:[t.jsxs("b",{children:[o.name,o.id==="best"&&t.jsx("small",{children:" · the default"})]}),t.jsx("span",{children:o.note})]},o.id))}),t.jsx(re,{text:`squad config set quality ${i}`})]})}function qF({s:e}){const n=r1(),s=(()=>{try{return window.localStorage}catch{return null}})(),[r,i]=C.useState(()=>wt?Co(s).includes(wt):!1);return e.ready||e.approved||!wt?null:r&&n.on?t.jsxs("span",{className:"pill ok",children:[t.jsx(Zp,{size:13})," We will tell you when it is ready"]}):t.jsxs("button",{className:"btn",onClick:async()=>{n.on||await n.turnOn(),C7(s,wt),i(!0)},children:[t.jsx(Zp,{size:15})," Notify me when it is ready"]})}function OF({s:e}){const n=mw();return t.jsx("ol",{className:"ob-steps",children:e.steps.map(s=>t.jsx(zF,{st:s,now:n},s.id))})}function _F({s:e}){const[n,s]=C.useState(!1);return e.reads.length?t.jsxs("div",{className:"ob-reads",children:[t.jsxs("button",{className:"btn sm quiet",onClick:()=>s(!n),"aria-expanded":n,children:[n?t.jsx(ok,{size:14}):t.jsx(Jf,{size:14})," ",n?"Hide what the Architect read":"See what the Architect is reading"]}),n&&t.jsx("ul",{children:e.reads.map((r,i)=>t.jsx("li",{className:"mono",children:r},`${i}-${r}`))})]}):null}function gw(){const n=Yu().data?.setup,s=mw();if(!n||n.approved)return null;if(n.ready)return t.jsxs("div",{className:"ob-card ready",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(ge,{size:16,strokeWidth:2.5})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:n.empty?n.idea?"Your first stories are ready":"One question for you":"Your project overview is ready"}),t.jsx("span",{children:n.empty?n.idea?"What the Architect understood from what you said, for you to check.":"What do you want to build?":"squad-kit has read your project. Check what it understood, then start working."})]}),t.jsxs(Ce,{to:"/overview",className:"btn you sm",children:["Check it ",t.jsx(Vi,{size:14})]})]});const r=n.steps.find(o=>o.id===n.current),i=n.steps.findIndex(o=>o.id===n.current)+1;return t.jsxs("div",{className:`ob-card ${r?.state==="failed"||r?.state==="stopped"?"stop":""}`,children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:"Getting to know your project"}),t.jsxs("span",{children:["Step ",i," of ",n.total,": ",r?.label??"starting",r&&af(r,s)?` · ${af(r,s)}`:""]}),r?.note&&r.state!=="todo"&&t.jsx("small",{title:r.note,children:r.note}),t.jsx("span",{className:"ob-dots","aria-hidden":!0,children:n.steps.map(o=>t.jsx("i",{className:o.state},o.id))})]}),t.jsxs(Ce,{to:"/setup",className:"btn sm",children:["Open the setup ",t.jsx(Vi,{size:14})]})]})}function DF(){const e=Yu().data?.setup;return!!(e&&!e.approved)}function BF(){const e=Yu().data?.setup;return!!(e?.ready&&!e.approved)}const WF=[{to:"/overview",label:"Overview",icon:em,badge:"setup"},{to:"/requirements",label:"Requirements",icon:fk,badge:"reqs"},{to:"/board",label:"Board",icon:hk},{to:"/backlog",label:"Backlog",icon:a8},{to:"/inbox",label:"Waiting for you",icon:s8,badge:"you"},{to:"/conversations",label:"Conversations",icon:Ki,badge:"chats"},{to:"/releases",label:"Releases",icon:js},{to:"/architecture",label:"Architecture",icon:u8},{to:"/bugs",label:"Bugs",icon:Os,badge:"bugs"},{to:"/harness",label:"Harness",icon:iu},{to:"/settings",label:"Settings",icon:p8}];function UF(){const e=Ke(),{theme:n,toggleTheme:s,showCommands:r,toggleCommands:i}=Le(),o=Qc({select:A=>A.location.pathname}),l=e.data?.ready?e.data.meta:void 0,u=e.data?.ready?e.data.tickets:[],d=u.filter(A=>!A.mergedAt&&A.stage!=="done"&&!A.archived).length,p=Vu().length,f=u.filter(Xo).length+p,m=u.filter(A=>A.kind==="bug").length,x=(l?.user.name??"You").slice(0,2).toUpperCase(),y=Fo().data?.filter(A=>A.open).length??0,j=JI(),k=BF(),b=zb(5e3),S=e9(b.data?.breakdowns??[],l?.user.name),[N,$]=C.useState(!1);return C.useEffect(()=>$(!1),[o]),o.startsWith("/conversations")||o.startsWith("/setup")?t.jsxs("div",{className:"fullpage",children:[t.jsx(Af,{}),t.jsx(Ef,{}),t.jsx(P2,{}),t.jsx("div",{className:"canvas-b",children:t.jsx(Qp,{})})]}):t.jsxs("div",{className:`app ${j?"docked":""}`,children:[t.jsxs("header",{className:"mtop",children:[t.jsx("button",{className:"iconbtn",onClick:()=>$(!0),"aria-label":"Open the menu","aria-expanded":N,children:t.jsx(l8,{size:17})}),t.jsx(D,{as:"b",text:l?.project??"Your project"}),f>0&&t.jsx(Ce,{to:"/inbox",className:"badge you","aria-label":`${f} waiting for you`,children:f})]}),N&&t.jsx("div",{className:"side-veil",onClick:()=>$(!1)}),t.jsxs("aside",{className:`side ${N?"open":""}`,children:[t.jsxs("a",{className:"brand",href:"/",title:"All your projects",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("b",{children:"squad-kit"}),l?.engine==="demo"&&t.jsx("small",{title:"The squad plays back a recorded run",children:"Demo"})]}),t.jsxs("a",{className:"proj",href:"/",title:"All your projects",children:[t.jsx("span",{className:"pm",children:(l?.project??"P").charAt(0)}),t.jsxs("div",{children:[t.jsx(D,{as:"b",text:l?.project??"Your project"}),t.jsx("span",{children:d===1?"1 open ticket":`${d} open tickets`})]}),t.jsx(HN,{size:14,className:"sw"})]}),WF.map(A=>{const R=A.badge==="you"?f:A.badge==="bugs"?m:A.badge==="chats"?y:0;if(A.badge==="setup")return t.jsxs(Ce,{to:A.to,className:`nav ${o.startsWith(A.to)?"on":""}`,onClick:()=>$(!1),children:[t.jsx(A.icon,{size:16}),A.label,k&&t.jsx("span",{className:"badge you","aria-label":"Waits for you",children:"1"})]},A.to);if(A.badge==="reqs")return t.jsxs(Ce,{to:A.to,className:`nav ${o.startsWith(A.to)?"on":""}`,onClick:()=>$(!1),children:[t.jsx(A.icon,{size:16}),A.label,S>0?t.jsx("span",{className:"badge you","aria-label":`${S} ${S===1?"needs":"need"} you`,children:S}):t.jsx("span",{className:"badge new",children:"New"})]},A.to);const E=o.startsWith(A.to)||A.to==="/inbox"&&o.endsWith("/proof");return t.jsxs(Ce,{to:A.to,className:`nav ${E?"on":""}`,onClick:()=>$(!1),children:[t.jsx(A.icon,{size:16}),A.label,R>0&&t.jsx("span",{className:`badge ${A.badge==="you"?"you":A.badge==="chats"?"talk":""}`,children:R})]},A.to)}),t.jsx("div",{className:"grow"}),t.jsx(wF,{}),t.jsx("div",{className:"engines",children:(l?.tools??[]).map(A=>t.jsxs("div",{className:"row",children:[t.jsx("span",{children:A.name}),t.jsx("span",{className:`dot ${A.ready?"":"off"}`,children:A.ready?"Ready":"Not installed"})]},A.name))}),t.jsxs("button",{className:"switch",onClick:i,"aria-pressed":r,children:[t.jsxs("span",{children:[t.jsx(No,{size:15}),"Show commands"]}),t.jsx("span",{className:`tog ${r?"on":""}`})]}),t.jsxs("div",{className:"me",children:[t.jsx("span",{className:"av",children:x}),t.jsxs("div",{children:[l?.user.name??"You",t.jsx("small",{children:l?.user.role??""})]}),t.jsx("button",{className:"theme",onClick:s,"aria-label":n==="light"?"Switch to dark":"Switch to light",children:n==="light"?t.jsx(Ko,{size:15}):t.jsx(Yo,{size:15})})]})]}),t.jsxs("main",{className:"canvas",children:[t.jsxs(PF,{children:[t.jsx(Af,{}),t.jsx(Lk,{}),t.jsx(Ef,{}),e.data?.ready&&t.jsx(jF,{}),e.data?.ready&&e.data.console?.outdated&&t.jsx(_8,{}),t.jsx(P2,{})]}),t.jsx("div",{className:"canvas-b",children:t.jsx(Qp,{})})]}),t.jsx(tF,{}),t.jsx(l7,{})]})}function xw({error:e,reset:n}){const s=e instanceof Error?e.stack??e.message:String(e);return t.jsx("div",{className:"center",role:"alert",style:{padding:24},children:t.jsxs("div",{style:{maxWidth:520},children:[t.jsxs("h2",{children:[t.jsx(kr,{size:18,style:{verticalAlign:"-3px",marginRight:8}}),"This page ran into a problem"]}),t.jsx("p",{children:"Your work is safe, and so is what you typed. Try again, or go on from the board."}),t.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:12},children:[t.jsx("button",{className:"btn pri",onClick:()=>n?n():window.location.reload(),children:"Try again"}),t.jsx("a",{className:"btn",href:`${Hi}/board`,children:"Go to the board"}),t.jsx("button",{className:"btn",onClick:()=>Go.open({}),children:"Report a problem"})]}),t.jsxs("details",{style:{marginTop:14},children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("pre",{className:"mono",style:{fontSize:12,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:s})]})]})})}class O2 extends C.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,s){console.error(n,s.componentStack)}render(){return this.state.error===null?this.props.children:this.props.fallback??t.jsx(xw,{error:this.state.error,reset:()=>this.setState({error:null})})}}const Tp=12;function u1({file:e,note:n}){const r=$e({queryKey:["api-proof",e],queryFn:async()=>(await fetch(ss(`/api/v1/proof/${e}`))).json()}).data;return r?t.jsxs("div",{className:"apiproof",children:[n&&t.jsx(D,{as:"p",text:n}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Asked"}),t.jsxs("span",{className:"mono",children:[r.part,": ",r.method," ",r.path]})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"It answered"}),t.jsxs("span",{className:"mono",children:[r.status,r.file?" with a file":""]})]}),r.sheets?.map((i,o)=>t.jsxs("div",{className:"apiproof-sheet",children:[t.jsx(D,{as:"b",text:i.name}),t.jsx("div",{className:"apiproof-table",children:t.jsx("table",{dir:E8(i.rows),children:t.jsx("tbody",{children:i.rows.slice(0,Tp).map((l,u)=>t.jsx("tr",{children:l.map((d,p)=>u===0?t.jsx("th",{...De(d),children:d},p):t.jsx("td",{...De(d),children:d},p))},u))})})}),i.total>Tp&&t.jsxs("p",{className:"note",children:["The first ",Tp," of ",i.total," rows. The file has them all."]})]},o)),r.file&&t.jsx("p",{children:t.jsx("a",{className:"btn sm",href:ss(`/api/v1/proof/${r.file}`),download:r.file,children:"Open the file it answered with"})}),t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsxs("pre",{className:"mono apiproof-raw",children:[r.body?`Sent: ${r.body}
648
+
649
+ `:"",r.contentType?`Type: ${r.contentType}
650
+
651
+ `:"",r.answer??(r.file?`A file of ${r.bytes??0} bytes`:"No answer"),r.cut?`
652
+
653
+ (cut here: the rest is not kept)`:""]})]})]}):n?t.jsx("p",{className:"note",children:n}):null}function HF(e,n,s=3){const r=e?e.split(`
654
+ `):[],i=n.split(`
655
+ `);if(r.length*i.length>25e4)return[...r.map(y=>({kind:"del",text:y})),...i.map(y=>({kind:"add",text:y}))];const o=r.length,l=i.length,u=Array.from({length:o+1},()=>new Array(l+1).fill(0));for(let y=o-1;y>=0;y--)for(let j=l-1;j>=0;j--)u[y][j]=r[y]===i[j]?u[y+1][j+1]+1:Math.max(u[y+1][j],u[y][j+1]);const d=[];let p=0,f=0;for(;p<o&&f<l;)r[p]===i[f]?(d.push({kind:"same",text:r[p]}),p++,f++):u[p+1][f]>=u[p][f+1]?d.push({kind:"del",text:r[p++]}):d.push({kind:"add",text:i[f++]});for(;p<o;)d.push({kind:"del",text:r[p++]});for(;f<l;)d.push({kind:"add",text:i[f++]});const m=d.map((y,j)=>y.kind!=="same"||d.slice(Math.max(0,j-s),j+s+1).some(k=>k.kind!=="same")),x=[];return d.forEach((y,j)=>{m[j]?x.push(y):x.at(-1)?.kind!=="gap"&&x.push({kind:"gap",text:""})}),x}function VF({t:e,onTab:n}){const[s,r]=C.useState("happened"),[i,o]=C.useState(null),l=dw(e),u=l.data?.steps??[];return t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"convbar",children:[t.jsxs("div",{className:"seg",role:"group","aria-label":"View",children:[t.jsx("button",{className:s==="happened"?"on":"","aria-pressed":s==="happened",onClick:()=>r("happened"),children:"What happened"}),t.jsx("button",{className:s==="log"?"on":"","aria-pressed":s==="log",onClick:()=>r("log"),children:"Full log"})]}),t.jsx("span",{className:"grow"}),s==="happened"&&u.length>0&&t.jsxs("span",{className:"note convcount",children:[u.length," ",u.length===1?"step":"steps",l.data.seconds>=1?` · ${Ku(l.data.seconds)} in all`:""]})]}),s==="happened"?t.jsx(nF,{t:e,onTab:n,onLog:d=>{o(d),r("log")}}):t.jsx(KF,{t:e,chosenKey:i,setKey:o})]})}function KF({t:e,chosenKey:n,setKey:s}){const i=$e({queryKey:["conversations",e.id],queryFn:()=>Se(`/api/v1/tickets/${e.id}/conversations`),refetchInterval:3e3}).data??[],o=n??i.filter(m=>m.started).at(-1)?.key??null,l=$e({queryKey:["conversation",e.id,o],queryFn:()=>Se(`/api/v1/tickets/${e.id}/conversations/${o}`),enabled:!!o,refetchInterval:e.live?2e3:1e4}),u=C.useMemo(()=>wb(l.data?.updates??[]),[l.data]),[d,p]=C.useState(!0),f=C.useRef(null);return C.useEffect(()=>{d&&f.current?.scrollIntoView({block:"end"})},[u.length,d,o]),i.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pills",style:{marginBottom:6},children:[i.map(m=>t.jsx("button",{className:`btn sm ${m.key===o?"pri":""}`,disabled:!m.started,onClick:()=>s(m.key),children:m.label},m.key)),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"note",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12.5},children:[t.jsx("input",{type:"checkbox",checked:d,onChange:m=>p(m.target.checked)})," Follow live"]})]}),t.jsxs("p",{className:"note",style:{fontSize:12.5,margin:"0 0 14px"},children:["Everything the ",i.find(m=>m.key===o)?.label??"agent"," did, step by step. Read only."," ",l.data&&l.data.total>(l.data.updates.length??0)?`Showing the latest ${l.data.updates.length} of ${l.data.total} entries.`:""]}),t.jsxs("div",{className:"conv",children:[u.map((m,x)=>t.jsx(GF,{it:m,ticket:e.id,cwd:l.data?.cwd},m.kind==="tool"?m.id:x)),t.jsx("div",{ref:f})]}),o&&t.jsxs("div",{className:"convactions",children:[t.jsx(YF,{t:e,to:_2[o]??"builder"}),!e.chat?.open&&!e.takenOver&&t.jsx(li,{t:e,agent:_2[o]??"builder"})]}),l.data?.command&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Open it in ",l.data.tool??"a terminal"]}),t.jsx(re,{text:l.data.command}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:6},children:o==="build"&&Gm(e)?t.jsxs(t.Fragment,{children:["To work in it yourself, press ",t.jsx("b",{children:"Take over"})," first, so you and the squad never edit at the same time."," ",t.jsx(Qm,{t:e})]}):e.takenOver?.free?"It is in a conversation outside squad-kit. Bring it back on the Now tab.":e.takenOver?"The ticket is yours: type into it freely, then press Give back on the Now tab.":"Read it any time. To work in it, take the ticket over while it is being built."})]})]}):t.jsx("p",{className:"note",children:"No conversation yet. It starts when the Analyst reads the ticket."})}const _2={intake:"analyst",build:"builder",review:"reviewer",tester:"tester"},D2={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"};function YF({t:e,to:n}){const s=pe(),[r,i]=Ne(e.id,`message-${n}`,"");if(e.stage==="done")return null;const o=()=>s.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:r,to:n},done:`Sent. ${e.now?.noteWhen??`The ${D2[n]} reads it at its next step.`}`},{onSuccess:()=>i("")});return t.jsxs("div",{className:"msgagent",children:[t.jsx("input",{className:"input",dir:xe(r),value:r,onChange:l=>i(l.target.value),placeholder:`Message the ${D2[n]}…`,onKeyDown:l=>l.key==="Enter"&&r.trim()&&!s.isPending&&o()}),t.jsxs("button",{className:"btn sm pri",disabled:!r.trim()||s.isPending,onClick:o,children:[t.jsx(ws,{size:13})," Send"]})]})}function GF({it:e,ticket:n,cwd:s}){if(e.kind==="plan")return t.jsx(sz,{entries:e.entries});if(e.kind==="tool")return t.jsx(XF,{it:e,ticket:n,cwd:s});const{from:r,content:i}=e;return r==="agent"?t.jsx("div",{className:"conv-text",children:t.jsx(d1,{content:i,ticket:n})}):t.jsx(QF,{from:r,content:i,ticket:n})}function QF({from:e,content:n,ticket:s}){const r=n.type==="text"?n.text:"",i=r.length>420||r.split(`
656
+ `).length>8,[o,l]=C.useState(!i&&e!=="thought"),u=e==="squad-kit"?"squad-kit asked":e==="claude-code"?"Note from Claude Code":"Thinking";return t.jsxs("div",{className:e==="thought"?"conv-thought":"conv-prompt",children:[t.jsxs("button",{className:"conv-who linkish",onClick:()=>l(!o),children:[e==="thought"&&t.jsx(ik,{size:12})," ",u," ",!o&&t.jsx("span",{className:"note",children:"· show"})]}),o&&(e==="thought"?t.jsx(um,{style:{whiteSpace:"pre-wrap"},text:r}):t.jsx(d1,{content:n,ticket:s}))]})}const ZF={read:Eu,edit:ru,delete:Qe,move:ru,search:ti,execute:No,think:ik,fetch:e8,switch_mode:tf,other:tf};function XF({it:e,ticket:n,cwd:s}){const r=e.content.some(f=>f.type==="content"&&(f.content.type==="image"||f.content.type==="resource_link")),i=e.content.some(f=>f.type==="diff"),o=e.status==="failed"&&!e.skipped,[l,u]=C.useState(!e.skipped&&(i||r||o));C.useEffect(()=>{(o||r)&&u(!0)},[o,r]);const d=e.answer?ws:e.skipped?Vo:ZF[e.toolKind]??tf,p=e.content.length>0||e.command||e.skipped;return t.jsxs("div",{className:`conv-tool ${e.skipped?"skipped":e.status}`,children:[t.jsxs("button",{className:"conv-tool-head",onClick:()=>p&&u(!l),"aria-expanded":l,children:[t.jsx(d,{size:14}),t.jsx("span",{className:"mono conv-tool-title",children:s?e.title.split(`${s}/`).join(""):e.title}),t.jsx("span",{className:"conv-at",children:e.at?Wn(e.at):""}),t.jsx(ez,{status:e.status,skipped:e.skipped})]}),e.blocked?.map(f=>t.jsx(JF,{line:f},f)),l&&p&&t.jsxs("div",{className:"conv-tool-body",children:[e.skipped&&t.jsx("p",{className:"note",children:"By design, nothing went wrong: squad-kit lets each step do only what it needs, and this was not part of it."}),e.command&&e.toolKind==="execute"?t.jsxs("pre",{className:"conv-cmd",children:["$ ",e.command]}):e.skipped&&e.detail&&t.jsx("pre",{className:"conv-cmd",children:e.detail}),e.content.map((f,m)=>t.jsx(tz,{c:f,ticket:n,cwd:s},m))]})]})}function JF({line:e}){const n=e.endsWith("Allow it in Settings.");return t.jsxs("p",{className:"conv-blocked",children:[t.jsx(rm,{size:13,"aria-hidden":"true"}),t.jsxs("span",{children:[n?e.slice(0,-9):e,n&&t.jsxs(t.Fragment,{children:[t.jsx(Ce,{to:"/settings",children:"Settings"}),"."]})]})]})}function ez({status:e,skipped:n}){return n?t.jsxs("span",{className:"conv-status skip",children:[t.jsx(Vo,{size:12})," Skipped"]}):e==="completed"?t.jsxs("span",{className:"conv-status ok",children:[t.jsx(ge,{size:12})," Done"]}):e==="failed"?t.jsxs("span",{className:"conv-status bad",children:[t.jsx(Qe,{size:12})," Failed"]}):t.jsxs("span",{className:"conv-status run",children:[t.jsx(pn,{size:12,className:"spin"})," Running"]})}function tz({c:e,ticket:n,cwd:s}){if(e.type==="diff"){const r=s&&e.path.startsWith(`${s}/`)?e.path.slice(s.length+1):e.path;return t.jsx(nz,{path:r,oldText:e.oldText??"",newText:e.newText,isNew:e.oldText==null})}return e.type==="terminal"?t.jsxs("p",{className:"note",children:["Terminal ",e.terminalId]}):e.content.type==="text"?e.content.text.trimStart().startsWith("```")?t.jsx(jw,{text:e.content.text}):t.jsx(yw,{text:e.content.text}):t.jsx(d1,{content:e.content,ticket:n})}function yw({text:e}){const n=e.length>600||e.split(`
657
+ `).length>12,[s,r]=C.useState(!n);return t.jsxs("div",{className:"conv-out",children:[t.jsx("pre",{children:s?e:`${e.split(`
658
+ `).slice(0,10).join(`
659
+ `).slice(0,600)}…`}),n&&t.jsx("button",{className:"linkbtn",onClick:()=>r(!s),children:s?"Show less":"Show all output"})]})}function nz({path:e,oldText:n,newText:s,isNew:r}){const i=C.useMemo(()=>HF(n,s),[n,s]),o=i.filter(f=>f.kind==="add").length,l=i.filter(f=>f.kind==="del").length,[u,d]=C.useState(i.length<=40),p=u?i:i.slice(0,40);return t.jsxs("div",{className:"conv-diff",children:[t.jsxs("div",{className:"conv-diff-head mono",children:[t.jsx("span",{style:{overflowWrap:"anywhere"},children:e}),t.jsx("span",{className:"grow"}),r?t.jsxs("span",{className:"add",children:["new file · ",o," lines"]}):t.jsxs("span",{children:[t.jsxs("span",{className:"add",children:["+",o]})," ",t.jsxs("span",{className:"del",children:["−",l]})]})]}),t.jsx("pre",{children:p.map((f,m)=>f.kind==="gap"?t.jsx("div",{className:"gap",children:"⋯"},m):t.jsxs("div",{className:f.kind,children:[t.jsx("span",{className:"sign",children:f.kind==="add"?"+":f.kind==="del"?"−":" "}),f.text||" "]},m))}),i.length>40&&t.jsx("button",{className:"linkbtn",style:{margin:"0 10px 8px"},onClick:()=>d(!u),children:u?"Show less":`Show all ${i.length} lines`})]})}function sz({entries:e}){const n=e.filter(s=>s.status==="completed").length;return t.jsxs("div",{className:"conv-plan",children:[t.jsxs("div",{className:"conv-who",children:[t.jsx(pk,{size:13})," Plan · ",n," of ",e.length," done"]}),e.map((s,r)=>t.jsxs("div",{className:`conv-plan-row ${s.status}`,...De(s.content),children:[t.jsx("span",{className:"box",children:s.status==="completed"?t.jsx(ge,{size:11}):s.status==="in_progress"?t.jsx(pn,{size:11,className:"spin"}):null}),t.jsx(D,{text:s.content})]},r))]})}function d1({content:e,ticket:n}){switch(e.type){case"text":return t.jsx(jw,{text:e.text});case"image":return t.jsx(_m,{className:"conv-img",src:`data:${e.mimeType};base64,${e.data}`,alt:"Picture the agent looked at"});case"audio":return t.jsx("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});case"resource_link":return t.jsx(B2,{uri:e.uri,name:e.name,mime:e.mimeType??"",size:e.size??void 0,ticket:n});case"resource":return e.resource.text?t.jsx(yw,{text:e.resource.text}):t.jsx(B2,{uri:e.resource.uri,name:e.resource.uri.split("/").pop()??"file",mime:e.resource.mimeType??"",ticket:n})}}function B2({uri:e,name:n,mime:s,size:r,ticket:i}){const o=wn(i,e);return s.startsWith("image/")&&s!=="image/svg+xml"?t.jsxs("div",{className:"conv-media",children:[t.jsx(_m,{className:"conv-img",src:o,alt:n}),t.jsx("span",{className:"note mono",children:n})]}):s.startsWith("video/")?t.jsxs("div",{className:"conv-media",children:[t.jsx("video",{className:"conv-img",src:o,controls:!0,preload:"metadata"}),t.jsx("span",{className:"note mono",children:n})]}):s.startsWith("audio/")?t.jsx("audio",{controls:!0,src:o}):t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:"conv-file",children:[t.jsx(ks,{size:15}),t.jsx("span",{className:"mono",children:n}),t.jsx("span",{className:"note",children:[s.split("/").pop(),r?`${Math.max(1,Math.round(r/1024))} KB`:""].filter(Boolean).join(" · ")})]})}const rz=[cm];function jw({text:e}){const{theme:n}=Le();return t.jsx("div",{className:"md",children:t.jsx(Im,{remarkPlugins:[qm],rehypePlugins:rz,components:{a:({href:s,children:r})=>t.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:r}),code:({className:s,children:r})=>{const i=/language-(\w+)/.exec(s??"")?.[1],o=String(r).replace(/\n$/,"");return!i&&!o.includes(`
660
+ `)?t.jsx("code",{className:"mono",dir:"ltr",children:r}):t.jsxs("div",{className:"md-code",dir:"ltr",children:[i&&t.jsx("span",{className:"md-lang",children:i==="mermaid"?"Diagram (Mermaid)":i}),t.jsx(mb,{code:o,language:i??"text",theme:n==="dark"?Eo.vsDark:Eo.github,children:({tokens:l,getLineProps:u,getTokenProps:d})=>t.jsx("pre",{children:l.map((p,f)=>t.jsx("div",{...u({line:p}),children:p.map((m,x)=>t.jsx("span",{...d({token:m})},x))},f))})})]})}},children:e})})}const iz=(e,n)=>e.part===n.part&&(e.index??0)===(n.index??0);function Ac({review:e,at:n,dir:s,children:r}){const[i,o]=Ne(e?.t.id??"none",`comment-${n.part}-${n.index??0}`,""),[l,u]=C.useState(i?"comment":null);if(!e)return t.jsx(t.Fragment,{children:r});const d=e.comments.map((f,m)=>({c:f,i:m})).filter(({c:f})=>iz(f,n)),p=()=>{i.trim()&&e.add({...n,text:i.trim()}),o(""),u(null)};return t.jsxs("div",{className:`part ${l?"open":""}`,dir:s,children:[t.jsxs("div",{className:"partbody",children:[t.jsx("div",{className:"partmain",children:l==="edit"?t.jsx(az,{review:e,at:n,onDone:()=>u(null)}):r}),l!=="edit"&&t.jsxs("span",{className:"parttools",children:[t.jsx("button",{className:"iconbtn",title:"Comment on this","aria-label":"Comment on this",onClick:()=>u("comment"),children:t.jsx(ny,{size:13})}),e.canEdit(n)&&t.jsx("button",{className:"iconbtn",title:"Edit it yourself","aria-label":"Edit it yourself",onClick:()=>u("edit"),children:t.jsx(ru,{size:13})})]})]}),d.map(({c:f,i:m})=>t.jsxs("div",{className:"pcomment",children:[t.jsx(ny,{size:12})," ",t.jsx(D,{text:f.text}),t.jsx("button",{className:"iconbtn","aria-label":"Remove comment",onClick:()=>e.remove(m),children:t.jsx(Qe,{size:12})})]},m)),l==="comment"&&t.jsxs("div",{className:"pcomment new",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(i),value:i,placeholder:"Your comment on this part. Enter to add",onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&p(),f.key==="Escape"&&u(null)}}),t.jsx("button",{className:"btn sm",onClick:p,children:"Add"})]})]})}function az({review:e,at:n,onDone:s}){const r=pe(),i=e.t,o=n.index??0,[l,u]=Ne(i.id,`edit-${n.part}-${o}`,n.part==="story"?i.story??"":n.part==="step"?i.steps?.[o]?.title??"":""),[d,p]=Ne(i.id,`edit-criterion-${o}`,i.criteria?.[o]??{given:"",when:"",then:""}),f=()=>r.mutate({path:`/api/v1/tickets/${i.id}/plan/edit`,body:n.part==="criterion"?{...n,criterion:d}:{...n,text:l},done:"Edited. Your wording stays."},{onSuccess:()=>{Ro(Qi(wt,i.id,`edit-${n.part}-${o}`)),Ro(Qi(wt,i.id,`edit-criterion-${o}`)),s()}});return t.jsxs("div",{className:"editpart",children:[n.part==="criterion"?["given","when","then"].map(m=>t.jsxs("label",{children:[t.jsx("em",{children:m[0].toUpperCase()+m.slice(1)}),t.jsx("input",{className:"input",dir:xe(d[m]),value:d[m],onChange:x=>p({...d,[m]:x.target.value})})]},m)):t.jsx("textarea",{className:"waynote",rows:n.part==="story"?3:2,autoFocus:!0,dir:xe(l),value:l,onChange:m=>u(m.target.value)}),t.jsxs("div",{className:"editbtns",children:[t.jsx("button",{className:"btn sm pri",disabled:r.isPending,onClick:f,children:"Save"}),t.jsx("button",{className:"btn sm",onClick:s,children:"Cancel"})]})]})}const W2=e=>e?`Given ${e.given}, when ${e.when}, then ${e.then}.`:"";function oz({t:e}){const[n,s]=C.useState(!0),r=e.planReview?.before;if(!r)return null;const i=[],o=(d,p="",f="")=>p!==f&&i.push({label:d,old:p,now:f});o("The story",r.story,e.story);const l=Math.max(r.criteria?.length??0,e.criteria?.length??0);for(let d=0;d<l;d++)o(`Done when ${d+1}`,W2(r.criteria?.[d]),W2(e.criteria?.[d]));(r.decision!==void 0||e.decision)&&o("The decision",r.decision,e.decision?`${e.decision.title}: ${e.decision.options.find(d=>d.chosen)?.name??""}`:"");const u=Math.max(r.steps?.length??0,e.steps?.length??0);for(let d=0;d<u;d++)o(`Step ${d+1}`,r.steps?.[d],e.steps?.[d]?.title);return t.jsxs("div",{className:"changed",children:[t.jsxs("button",{className:"changedhead",onClick:()=>s(!n),children:[t.jsx("b",{children:"What changed"})," ",i.length?`${i.length} ${i.length===1?"part":"parts"}`:"nothing"," since the last version ",n?"▾":"▸"]}),n&&t.jsxs(t.Fragment,{children:[(e.planReview?.sent??[]).length>0&&t.jsxs("div",{className:"sentlist",children:["Your comments:"," ",e.planReview.sent.map((d,p)=>t.jsx(D,{text:`“${d.text}”`},p))]}),i.map(d=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:d.label}),d.old?t.jsx(D,{as:"div",className:"chold",text:d.old}):t.jsx("div",{className:"chold empty",children:t.jsx("i",{children:"new"})}),d.now?t.jsx(D,{as:"div",className:"chnew",text:d.now}):t.jsx("div",{className:"chnew",children:t.jsx("i",{children:"removed"})})]},d.label))]})]})}function kw(e){return!!(e.now&&(e.now.state==="working"||e.now.state==="queued"||e.now.state==="stopping"))}function lz(e){const n=Math.max(0,Math.floor((Date.now()-Date.parse(e))/1e3));if(n<2)return"just now";if(n<60)return`${n} seconds ago`;const s=Math.floor(n/60);return`${s} minute${s===1?"":"s"} ago`}function vw({bar:e,big:n}){return e?.length?t.jsx("div",{className:`segbar ${n?"big":""}`,"aria-hidden":!0,children:e.map((s,r)=>t.jsx("span",{className:s==="done"?"d":s==="now"?"n":""},r))}):null}function cz({t:e}){const n=e.now;if(n.state==="queued")return t.jsx(D,{as:"div",className:"nl1 quiet",text:n.line});const[s,...r]=n.line.split(" · "),i=e.quiet;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"nl1",children:[t.jsx("span",{className:"live"}),t.jsx(D,{lead:t.jsx("b",{children:s}),text:r.length?`· ${r.join(" · ")}`:""})]}),i?t.jsxs("div",{className:`nl2 slow ${i.kind}`,children:[i.kind==="stuck"?t.jsx(kr,{size:12}):t.jsx(lk,{size:12}),i.kind==="stuck"?"Looks stuck":"Taking longer than usual",n.seconds!==void 0&&i.kind==="long"?` · ${n.time?.split(" · ")[0]}`:""]}):n.time&&t.jsx("div",{className:"nl2",children:n.time}),t.jsx(vw,{bar:n.bar})]})}function bw({t:e}){const n=e.now,s=n.state==="queued"?"Next in line":n.state==="stopping"?"Stopping":"Working",[r,...i]=(n.detail??"").split(" · ");return t.jsxs("section",{className:"nowcard","aria-label":"What is happening now",children:[t.jsxs("div",{className:"nowhead",children:[n.state==="working"&&t.jsx("span",{className:"live"}),t.jsxs("span",{children:[s,n.state==="working"&&n.lastAt?` · last update ${lz(n.lastAt)}`:""]})]}),t.jsx(D,{as:"p",className:"nowsay",text:n.sentence}),n.detail&&(n.part?t.jsx(D,{as:"div",className:"nowmeta",lead:t.jsx("b",{children:r}),text:i.length?`· ${i.join(" · ")}`:""}):t.jsx(D,{as:"div",className:"nowmeta",text:n.detail})),t.jsx(vw,{bar:n.bar,big:!0}),n.next&&t.jsx(D,{as:"div",className:"nownext",lead:t.jsx("b",{children:"What comes next:"}),text:n.next})]})}function ww({t:e}){const n=e.now?.role==="squad"?"tester":e.now?.role,s=n?e.activity.filter(o=>o.who===n):[],r=(s.length>=2?s:e.activity).slice(0,6);if(!r.length)return null;const i=s.length>=2&&n?Ms[n]:"squad";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["What the ",i," did, in plain words"]}),t.jsx("div",{className:"feed",children:r.map((o,l)=>t.jsxs("div",{className:"fe",children:[t.jsx("span",{className:"tm",children:Wn(o.at)}),t.jsx(ni,{role:o.who,small:!0}),t.jsx(D,{text:o.text})]},o.at+l))})]})}function uz({t:e}){const n=pe(),[s,r]=C.useState(!1),i=e.now?.slow,o=n.isPending||e.stopRequested;if(!i)return null;const l=i.kind==="stuck",u=()=>n.mutate({path:`/api/v1/tickets/${e.id}/keep-waiting`,body:{minutes:10},done:"OK. squad-kit stays quiet about it for 10 minutes."}),d=()=>n.mutate({path:`/api/v1/tickets/${e.id}/restart`,done:"Stopping the step. It starts again at once, with the work so far."}),p=()=>n.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),f=()=>n.mutate({path:`/api/v1/tickets/${e.id}/unstick`,done:"Ended the stuck command. The squad carries on."}),m=()=>n.mutate({path:`/api/v1/tickets/${e.id}/free-port`,done:"Stopped it. The step starts again, with the work so far."},{onSettled:()=>r(!1)});return t.jsxs("section",{className:`slowcard ${l?"stuck":""}`,"aria-label":i.title,children:[t.jsxs("div",{className:"slowhead",children:[l?t.jsx(kr,{size:17}):t.jsx(lk,{size:17}),t.jsx("b",{children:i.title}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"where",children:i.where})]}),t.jsxs("div",{className:"slowbody",children:[t.jsx(D,{as:"p",className:"slowsay",text:i.text}),t.jsx("div",{className:"facts",children:i.facts.map(x=>t.jsxs("div",{className:"fact",children:[t.jsx("span",{children:x.label}),t.jsx(D,{text:x.value})]},x.label))}),t.jsxs("div",{className:"ways",children:[i.freePort&&t.jsx("button",{className:"btn pri",disabled:o,onClick:()=>r(!0),children:"Stop it and try again"}),l&&i.canEnd&&!i.freePort&&t.jsx("button",{className:"btn pri",disabled:o,onClick:f,children:"End the stuck command"}),!l&&t.jsx("button",{className:"btn you",disabled:o,onClick:u,children:"Give it 10 more minutes"}),t.jsx("button",{className:"btn",disabled:o,onClick:d,children:"Stop and try again"}),l&&t.jsx("button",{className:"btn",disabled:o,onClick:u,children:"Keep waiting"}),t.jsxs("button",{className:"btn",disabled:o,onClick:p,children:[t.jsx(is,{size:12})," Stop"]})]}),l&&i.canEnd&&t.jsx("p",{className:"note slownote",children:"Ending the command gives the squad an error back, and it carries on in the same conversation."}),i.detail&&t.jsxs("details",{className:"costdetails slownote",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsx("p",{className:"note",style:{whiteSpace:"pre-line",overflowWrap:"anywhere"},children:i.detail})]}),t.jsxs("div",{className:"slowfoot",children:[t.jsx("span",{children:i.limit??"Nothing is lost whatever you choose."}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:i.freePort?`squad unstick ${e.id} --free-port`:l&&i.canEnd?`squad unstick ${e.id}`:`squad wait ${e.id} --more 10m`})]})]}),s&&i.freePort&&t.jsxs(He,{title:"Stop it and try again?",onClose:()=>r(!1),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:m,children:n.isPending?"Stopping it…":"Stop it and try again"}),t.jsx("button",{className:"btn",onClick:()=>r(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad unstick ${e.id} --free-port`})]}),children:[t.jsxs("p",{children:["squad-kit stops ",i.freePort.what,", then starts this step again."," ",i.freePort.what.startsWith("your app")?"You can start it again from Your apps afterwards.":"squad-kit started that program itself, so nothing of yours is closed."]}),t.jsx("p",{className:"note",children:"The work so far is kept. squad-kit checks again that it started the program before it stops it."})]})]})}function Nw({t:e}){const[n,s]=Ne(e.id,"status-ask",""),[r,i]=C.useState([]),[o,l]=C.useState(!1),u=async()=>{const p=n.trim();if(!(!p||o)){l(!0);try{const f=await at(`/api/v1/tickets/${e.id}/status/ask`,"POST",{text:p});i(m=>[...m,{q:p,a:f,at:new Date().toISOString()}]),s("")}catch(f){i(m=>[...m,{q:p,error:f instanceof Error?f.message:String(f),at:new Date().toISOString()}])}finally{l(!1)}}},d=ht(n).dir;return t.jsxs("section",{className:"askbox","aria-label":"Ask about this ticket",children:[t.jsx("label",{htmlFor:`ask-${e.id}`,className:"lbl",children:"Ask about this ticket"}),r.length>0&&t.jsx("div",{className:"askthread",children:r.map((p,f)=>t.jsx(dz,{t:e,said:p},p.at+f))}),t.jsxs("div",{className:"askrow",children:[t.jsx("input",{id:`ask-${e.id}`,className:"input",dir:d,value:n,onChange:p=>s(p.target.value),onKeyDown:p=>p.key==="Enter"&&void u(),placeholder:"For example: is there a problem? when will it be ready?"}),t.jsxs("button",{className:"btn pri",disabled:!n.trim()||o,onClick:()=>void u(),children:[t.jsx(ws,{size:14})," Ask"]})]}),t.jsxs("div",{className:"askfoot",children:[t.jsx("span",{children:"Status answers come at once, in English or Arabic, with no AI cost. Questions for an agent reach it at its next safe moment."}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad status ${e.id}`})]})]})}function dz({t:e,said:n}){const s=n.a,r=s?.lang==="ar";return t.jsxs("div",{className:"askturn",children:[t.jsx(D,{as:"div",className:"askme",text:n.q}),t.jsxs("div",{className:`askit ${r?"ar":""}`,dir:r?"rtl":"ltr",lang:r?"ar":"en",children:[t.jsxs("div",{className:"who",children:[t.jsx("b",{children:"squad-kit"}),s?.instant&&t.jsx("span",{className:"tag",children:r?"إجابة فورية":"answered at once"}),t.jsx("span",{className:"note",children:Wn(n.at)})]}),n.error?t.jsx("p",{className:"err",children:n.error}):s?.lines.map((i,o)=>t.jsx("p",{children:t.jsx(Kt,{text:i,dir:r?"rtl":"ltr"})},o)),s&&s.offers.length>0&&t.jsx("div",{className:"askoffers",children:s.offers.map(i=>t.jsx(hz,{t:e,o:i,question:n.q},i.do+i.label))})]})]})}function hz({t:e,o:n,question:s}){const r=pe(),{toast:i}=Le(),[o,l]=C.useState(!1),[u,d]=C.useState(!1);switch(n.do){case"propose":return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm offer",onClick:()=>l(!0),children:[t.jsxs("span",{className:"ol",children:[t.jsx(vs,{size:13})," ",n.label]}),t.jsx("span",{className:"on",children:n.note})]}),o&&t.jsx(ll,{t:e,initial:s,onClose:()=>l(!1)})]});case"note":return t.jsxs("button",{className:"btn sm offer",disabled:u||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:s,...n.to?{to:n.to}:{}}},{onSuccess:()=>{d(!0),i(`Sent. ${n.note}`)}}),children:[t.jsxs("span",{className:"ol",children:[t.jsx(ws,{size:13})," ",u?"Sent":n.label]}),t.jsx("span",{className:"on",children:n.note})]});case"chat":return t.jsx(li,{t:e,agent:n.to,label:n.label});case"stop":return t.jsxs("button",{className:"btn sm",disabled:r.isPending||e.stopRequested,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),children:[t.jsx(is,{size:12})," ",n.label]})}}function pz({t:e}){const n=pe(),[s,r]=C.useState(!1),i=e.agentQuestion,o=i.port,l=i.options.find(p=>p==="Stop it"),u=i.options.find(p=>p!=="Stop it"),d=(p,f)=>n.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:p},done:f},{onSettled:()=>r(!1)});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:"?"}),t.jsxs("div",{children:[t.jsx("b",{children:"Another program is in the way"}),t.jsx("span",{children:"You decide. Nothing is stopped unless you press Stop it."})]})]}),t.jsx("div",{className:"lbl",children:"What is in the way"}),t.jsx(D,{as:"p",className:"stuckq",text:i.text}),i.why&&t.jsx(D,{as:"p",className:"note",text:i.why}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:[o.program||"A program",o.pid?` (process ${o.pid})`:", which the system does not name,",o.port?` listens on port ${o.port}`:"",o.app?`: your app ${o.app}, which squad-kit runs from Your apps`:"","."]}),t.jsxs("p",{className:"note",children:["The Builder asked: “",o.asked,"”"]})]})]}),t.jsxs("div",{className:"df",children:[l&&t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:()=>r(!0),children:l}),u&&t.jsx("button",{className:`btn ${l?"":"pri"}`,disabled:n.isPending,onClick:()=>d(u,"Sent. The Builder carries on without it."),children:u}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad reply ${e.id} ${Me(l??u??"")}`})]}),s&&l&&t.jsxs(He,{title:o.app?`Stop your app ${o.app}?`:"Stop that program?",onClose:()=>r(!1),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:()=>d(l,"Stopping it. The Builder carries on."),children:n.isPending?"Stopping it…":"Stop it"}),t.jsx("button",{className:"btn",onClick:()=>r(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad reply ${e.id} ${Me(l)}`})]}),children:[t.jsxs("p",{children:["squad-kit stops ",o.app?`your app ${o.app}`:"that program",", then the Builder carries on. ",o.app?"You can start it again from Your apps afterwards.":"Anything not saved in that program is lost."]}),t.jsx("p",{className:"note",children:"squad-kit checks again first that it is still the same program."})]})]})}function Sw({t:e,banner:n}){const s=pe(),r=e.testChange;if(!r?.ask)return null;const i=l=>s.mutate({path:`/api/v1/tickets/${e.id}/test-command`,body:{use:l},done:l?"squad-kit tests this project the new way from now on.":"squad-kit keeps the current way of testing."}),o=t.jsxs("div",{className:"outdated-item testchange",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:t.jsx(GN,{size:15})}),t.jsx("b",{children:"The way this project's tests run changed, and squad-kit cannot tell if the new way checks as much as the current one."})]}),t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:s.isPending,title:"The checks stay as they are, and the Builder fixes what they find.",onClick:()=>i(!1),children:"Keep the current way"}),t.jsx("button",{className:"btn sm",disabled:s.isPending,title:"The checks use the new way from now on.",onClick:()=>i(!0),children:"Use the new way"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad test-command ${e.id} --keep`})]}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:["Current: ",t.jsx("code",{children:r.from}),t.jsx("br",{}),"New: ",t.jsx("code",{children:r.to}),r.ran?t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r.ran]}):null]})]})]});return n?t.jsx("div",{className:"outdated","aria-label":"A choice about the tests",children:o}):o}const h1="No tests ran, so squad-kit could not check that the work does what it should. Check the proof with extra care. To turn tests on, have an engineer add tests to the project.";function Cw(e){return e?.checks==="unchecked"?"Not checked: no tests ran":e?.checks==="skipped"?/weakened/i.test(e.checksText??"")?"Tests weakened, you continued":"Checks failed, you continued":e?.checksText??"All checks pass"}function fz(e){if(e?.checks!=="unchecked")return null;const n=e.checksText?.split(" · ").slice(1).join(" · ");return h1.replace("Check the proof",`${n?`Passed: ${n}. `:""}Check the proof`)}function Gu(e){return e?.checks==="pending"&&e.review==="pending"&&e.proof==="pending"}function mz(e){if(Gu(e))return"Built outside squad-kit, so squad-kit has not checked it. Try it yourself, or press Check at the top.";const n='Compare the screens before and after each "done when".';return e?.checks==="unchecked"?`Not checked: no tests ran, so look closely. ${n}`:e&&[e.checks,e.review,e.proof].some(s=>s==="skipped")?`You went past a gate, so look closely. ${n}`:`Every gate is green. ${n}`}function $w(e){const n=(e.proof??[]).some(i=>i.shows==="broken"),s=(e.proof??[]).some(i=>i.shows==="not-shown"),r=(e.proof??[]).some(i=>i.shows==="off-screen");return e.gates?.proof==="skipped"?n?'A "done when" not working, you continued':s?'A "done when" not shown, you continued':r?"Not on a screen, you continued":"No screenshots, you continued":e.gates?.proof==="fail"&&n?'A "done when" not working yet':e.gates?.proof==="fail"&&s?'A "done when" not shown yet':e.gates?.proof==="fail"&&r?"Nothing shows on a screen yet":"Proof made"}function Tw(e){return Gu(e.gates)?"None yet. squad-kit makes them when you press Check.":e.gates?.proof==="skipped"||(e.work?.screens??0)>0?"No screenshots were taken for this ticket. See the activity for why.":e.gates?.checks==="unchecked"?"No screens change in this ticket and no tests ran, so read the changes in the Changes tab.":"No screens change in this ticket, so the passing checks are the proof."}function gz(e){return e.added?`team's check "${e.added}"`:e.weakened?.length?"weakened tests":e.gate==="hooks"?"project's own check":e.gate==="checks"?"failed checks":e.gate==="proof"?"unfinished proof":"open review"}function es({state:e,text:n}){const s=e==="pass"?"ok":e==="skipped"?"skip":e==="unchecked"?"unchecked":"wait";return t.jsxs("span",{className:`pill ${s}`,title:e==="unchecked"?h1:void 0,children:[e==="pass"&&t.jsx(ge,{size:13,strokeWidth:2.5}),e==="unchecked"&&t.jsx(jr,{size:13,strokeWidth:2.5}),n]})}function Ew({g:e,className:n=""}){const s=fz(e);return s?t.jsxs("p",{className:`note unchecked-why ${n}`,children:[t.jsx(jr,{size:14,strokeWidth:2.4,"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("b",{children:"Not checked."})," ",s]})]}):null}function xz(e){return e==="met"?"Met":e==="broken"?"Not working yet":e==="not-shown"?"Not shown yet":e==="off-screen"?"Not on a screen":null}function p1(e){return e==="met"?"met":e==="broken"?"broken":e==="not-shown"?"notshown":e==="off-screen"?"notonscreen":""}function Lo(e){return e.shows==="broken"||e.shows==="not-shown"||e.shows==="off-screen"?e.why??e.note??"":e.note??""}function yz(e){const n=(e.proof??[]).filter(s=>s.shows==="off-screen").map(s=>({criterion:s.criterion,why:Lo(s)}));return[...n,...(e.offScreen??[]).filter(s=>!n.some(r=>r.criterion===s.criterion))]}const Mo=e=>e.endsWith(".api.json"),jz=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="640" height="200"><text x="24" y="100" font-family="sans-serif" font-size="20">An answer from the API, not a picture</text></svg>')}`;function Aw(e,n){const s=o=>Mo(o)?jz:n(o),r=[],i=[];for(const o of e)i.push(r.length),r.push({src:s(o.before),caption:`${o.criterion} · ${o.beforeLabel}`},{src:s(o.after),caption:`${o.criterion} · ${o.afterLabel}`}),(o.more??[]).forEach((l,u)=>r.push({src:s(l.after),caption:`${o.criterion} · ${l.note||`Picture ${u+2}`}`}));return{pictures:r,starts:i}}function Pw({shows:e,size:n=15}){return e==="broken"?t.jsx(Qe,{size:n,strokeWidth:2.5,className:"vx","aria-hidden":"true"}):e==="not-shown"?t.jsx(uk,{size:n,strokeWidth:2.25,className:"vq","aria-hidden":"true"}):e==="off-screen"?t.jsx(c8,{size:n,strokeWidth:2.25,className:"vo","aria-hidden":"true"}):t.jsx(ge,{size:n,strokeWidth:2.5,"aria-hidden":"true"})}function Rf({shows:e}){const n=xz(e);return n?t.jsx("span",{className:`verdict ${p1(e)}`,children:n}):null}function Rw({shot:e,first:n,onOpen:s}){return e.more?.length?t.jsxs("div",{className:"proofmore",children:[t.jsx("small",{children:'More pictures of this "done when"'}),t.jsx("div",{className:"proofmore-row",children:e.more.map((r,i)=>t.jsxs("figure",{children:[Mo(r.after)?t.jsx(u1,{file:r.after}):t.jsx("button",{className:"zoom",onClick:()=>s(n+i),"aria-label":`Open picture ${i+2} of this "done when" full size`,children:t.jsx("img",{src:ss(`/api/v1/proof/${r.after}`),alt:`${e.criterion}, ${r.note||`picture ${i+2}`}`,loading:"lazy"})}),t.jsxs("figcaption",{children:[r.note&&t.jsx(D,{text:r.note}),Gr(r)&&t.jsx("code",{children:Gr(r)})]})]},r.after))})]}):null}function ua({t:e,className:n}){return t.jsxs(t.Fragment,{children:[!!e.alsoChanged?.length&&t.jsx(D,{as:"p",className:`note alsochanged${n?` ${n}`:""}`,lead:t.jsx("b",{children:"Also changed, not in the plan:"}),text:`${e.alsoChanged.join("; ")}.`}),t.jsx(kz,{t:e})]})}const U2={passed:["Passed","ok"],failed:["Did not pass","bug"],warned:["Did not pass, warn only","you"],"would-stop":["Would have stopped","you"],"cant-run":["Could not run","you"]};function kz({t:e}){return e.added?.length?t.jsxs("div",{className:"teamres",children:[t.jsx("div",{className:"lbl",children:"Added by your team"}),e.added.map(n=>t.jsxs("div",{children:[t.jsxs("div",{className:"teamtop",children:[t.jsx(D,{as:"b",text:n.name}),n.result&&t.jsx("span",{className:`pill ${U2[n.result][1]}`,children:U2[n.result][0]}),n.state==="try"&&t.jsx("small",{children:"On Try first, it stops nothing"})]}),n.why&&t.jsx(D,{as:"p",className:"note",text:n.why}),n.answers&&t.jsx("ol",{dir:ht(n.answers.map(s=>s.question).join(" ")).dir,children:n.answers.map(s=>t.jsxs("li",{...De(s.question),children:[t.jsx(D,{text:s.question})," ",t.jsx("b",{className:s.answer==="no"?"no":"",children:s.answer==="yes"?"Yes":s.answer==="no"?"No":"Not answered"}),s.why&&t.jsx(D,{as:"small",text:` ${s.why}`})]},s.question))})]},n.id))]}):null}function If({t:e}){return!e.offScreen?.length||oa(e)?null:t.jsxs("div",{className:"offscreen",children:[t.jsx("div",{className:"lbl",children:"Not on a screen"}),t.jsx("ul",{children:e.offScreen.map(n=>t.jsxs("li",{children:[t.jsx(D,{as:"b",text:n.criterion}),t.jsx(D,{text:n.why})]},n.criterion))})]})}function vz({t:e}){const n=yz(e);return n.length?t.jsxs("div",{className:"offscreen",children:[t.jsx("div",{className:"lbl",children:"Not on a screen, so look at these yourself"}),t.jsx("ul",{children:n.map(s=>t.jsxs("li",{children:[t.jsx(D,{as:"b",text:s.criterion}),t.jsx(D,{text:s.why})]},s.criterion))})]}):null}function bz(e,n){return!!e.mergedAt||e.stage==="done"||n&&e.stage==="release"}function xu(e){return Cu.createPortal(e,document.body)}function wz(){const e=Ke();return e.data?.ready?e.data.meta.engine==="demo":!1}function Nz({t:e,onDeleted:n,items:s=[]}){const[r,i]=C.useState(!1),[o,l]=C.useState(null),u=bz(e,wz()),d=Iw(e),p=C.useRef(null);C.useEffect(()=>{if(!r)return;const m=y=>p.current&&!p.current.contains(y.target)&&i(!1),x=y=>y.key==="Escape"&&i(!1);return document.addEventListener("mousedown",m),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",x)}},[r]);const f=m=>()=>{i(!1),m()};return t.jsxs("span",{className:"more",ref:p,children:[t.jsx("button",{className:"iconbtn","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":r,title:"More actions",onClick:()=>i(!r),children:t.jsx(ck,{size:16})}),r&&t.jsxs("div",{className:"more-menu",role:"menu",children:[s.map(m=>t.jsx("button",{role:"menuitem",onClick:f(m.onPick),children:m.label},m.key)),e.archived?t.jsxs("button",{role:"menuitem",onClick:f(d),children:[t.jsx(sk,{size:15})," Unarchive"]}):u?t.jsxs("button",{role:"menuitem",onClick:f(()=>l("archive")),children:[t.jsx(tu,{size:15})," Archive…"]}):e.ownerDeleted?t.jsxs("button",{role:"menuitem",className:"danger",onClick:f(()=>l("delete")),children:[t.jsx(Cn,{size:15})," Remove from my board…"]}):t.jsxs("button",{role:"menuitem",className:"danger",onClick:f(()=>l("delete")),children:[t.jsx(Cn,{size:15})," Delete ticket…"]})]}),o==="delete"&&xu(t.jsx(Ff,{t:e,onClose:()=>l(null),onDeleted:n})),o==="archive"&&xu(t.jsx(Sz,{t:e,onClose:()=>l(null)}))]})}function Iw(e){const n=pe();return()=>n.mutate({path:`/api/v1/tickets/${e.id}/archive`,body:{undo:!0},done:`${e.id} is back on the board.`})}function yu({items:e,mark:n}){return t.jsx("ul",{className:"rmlist",children:e.map(s=>t.jsxs("li",{children:[n==="x"?t.jsx(Qe,{size:16,className:"x","aria-hidden":!0}):n==="hide"?t.jsx(uk,{size:16,className:"hide","aria-hidden":!0}):t.jsx(ge,{size:16,className:"ok","aria-hidden":!0}),t.jsx(D,{text:s})]},s))})}function Ff({t:e,onClose:n,onDeleted:s}){const r=pe(),{toast:i}=Le(),[o,l]=C.useState(!!e.deleting?.remote),u=$e({queryKey:["delete-plan",e.id,o],queryFn:()=>Se(`/api/v1/tickets/${e.id}/delete?remote=${o?1:0}`),placeholderData:j5}),d=u.data,p=!!(d?.local??e.ownerDeleted),f=()=>r.mutate({path:`/api/v1/tickets/${e.id}/delete`,body:{remote:o},done:p?`Removed ${e.id} from your board.`:`Deleted ${e.id}. Its cost stays in Usage.`},{onSuccess:m=>{m.notes.length&&i(`${m.notes.join(". ")}.`),n(),s()},onError:()=>void u.refetch()});return t.jsxs(He,{title:p?`Remove ${e.id} from your board?`:`Delete ${e.id}?`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(Cn,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn danger",disabled:!d||!!d.refused||r.isPending,onClick:f,children:[t.jsx(Cn,{size:15})," ",p?r.isPending?"Removing…":"Remove from my board":r.isPending?"Stopping the squad and deleting…":d?.unfinished?"Delete again":`Delete ${e.id}`]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:d?.command??`squad delete ${e.id}`})]}),children:[t.jsx(D,{as:"p",text:d?.summary??e.title}),u.isError&&t.jsx("div",{className:"stuckbox",children:u.error.message}),d?.refused&&t.jsx("div",{className:"stuckbox",children:d.refused}),d&&!d.refused&&t.jsxs(t.Fragment,{children:[d.unfinished&&t.jsxs("div",{className:"stuckbox rm-gap",children:["The last delete did not finish: ",d.unfinished,". Delete again to finish it. It goes on where it stopped."]}),d.warnings.length>0&&t.jsx("div",{className:"stuckbox rm-gap",children:d.warnings.map(m=>t.jsx(D,{as:"div",text:m},m))}),t.jsx("div",{className:"lbl",children:"This removes"}),t.jsx(yu,{items:d.removes,mark:"x"}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(yu,{items:d.stays,mark:"ok"}),d.pushed&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:o,onChange:m=>l(m.target.checked)}),t.jsxs("span",{children:[t.jsx("b",{children:"Also delete its work in your team's shared copy of the code."})," ",d.pushed.why]})]}),p?t.jsxs("p",{className:"rm-note",children:["Only ",d.local?.by??"its owner"," could delete ",e.id,". This cleans your computer only."]}):t.jsxs("p",{className:"rm-note",children:["A ticket that is already merged cannot be deleted, because its work is in the code already. Use ",t.jsx("b",{children:"Archive"})," to hide it from the board. Its history stays."]})]})]})}function Sz({t:e,onClose:n}){const s=pe(),r=()=>s.mutate({path:`/api/v1/tickets/${e.id}/archive`,done:`Archived ${e.id}. Show archived, at the bottom of the board, shows it again.`},{onSuccess:n});return t.jsxs(He,{title:`Archive ${e.id}?`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(tu,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:r,children:[t.jsx(tu,{size:15})," Archive ",e.id]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad archive ${e.id}`})]}),children:[t.jsx(D,{as:"p",text:`${e.title} · ${e.status}`}),t.jsx("div",{className:"lbl",children:"This hides"}),t.jsx(yu,{items:["The ticket from the board. Show archived, at the bottom of the board, shows it again."],mark:"hide"}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(yu,{items:["Its code, and its history in git and in .squad/",...e.release&&e.stage!=="done"?[`Its place in release ${e.release}`]:[],"The cost it used, still counted in Usage"],mark:"ok"}),t.jsx("p",{className:"rm-note",children:"Unarchive brings it back to the board, as it was."})]})}function Cz({t:e,onDeleted:n}){const[s,r]=C.useState(!1),i=Iw(e);if(e.ownerDeleted&&!e.deleting){const o=e.ownerDeleted;return t.jsxs("div",{className:"stuckbox rm-banner",children:[t.jsxs("span",{className:"grow",children:[t.jsxs("b",{children:["Deleted by ",o.by,"."]})," ",o.how==="note"?`${o.by} deleted ${e.id} on their computer ${St(o.at)}.`:`Its work is gone from your team's shared copy of the code, and it never reached the code itself, so ${o.by} deleted it.`," ","Only ",o.by," could delete it. Removing it here cleans your computer only."]}),t.jsxs("button",{className:"btn sm",onClick:()=>r(!0),children:[t.jsx(Cn,{size:13})," Remove from my board"]}),t.jsx(re,{text:`squad delete ${e.id}`}),s&&xu(t.jsx(Ff,{t:e,onClose:()=>r(!1),onDeleted:n}))]})}if(e.deleting){const o=!!e.deleting.error||Date.now()-Date.parse(e.deleting.at)>9e4;return t.jsxs("div",{className:"stuckbox rm-banner",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:e.deleting.error?"Delete did not finish.":"Deleting…"})," ",e.deleting.error?`${e.deleting.error}. Delete again to finish it; it goes on where it stopped.`:"The squad stops first, then each part of the ticket goes."]}),o&&t.jsxs("button",{className:"btn sm",onClick:()=>r(!0),children:[t.jsx(Cn,{size:13})," Delete again"]}),t.jsx(re,{text:`squad delete ${e.id}`}),s&&xu(t.jsx(Ff,{t:e,onClose:()=>r(!1),onDeleted:n}))]})}return e.archived?t.jsxs("div",{className:"calm rm-banner",children:[t.jsx("span",{className:"ring",children:t.jsx(tu,{size:16})}),t.jsxs("div",{className:"grow",children:[t.jsxs("b",{children:["Archived ",St(e.archived.at)," by ",e.archived.by]}),t.jsx("span",{children:"It is off the board. Its history stays in git and in .squad/."}),t.jsx("div",{className:"rm-cmd",children:t.jsx(re,{text:`squad archive ${e.id} --undo`})})]}),t.jsxs("button",{className:"btn sm",onClick:i,children:[t.jsx(sk,{size:13})," Unarchive"]})]}):null}function qo(e){return!!e.mergedAt||e.stage==="done"}function f1(e){const n=Ke(),s=n.data?.ready?[...n.data.tickets,...n.data.archived??[]]:[];return(e.dependsOn??[]).map(r=>s.find(i=>i.id===r)).filter(r=>!!r)}function $z(e){return e.waiting?.kind==="depends"||e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad&&!e.waiting}const Tz={branch:"--on-branch",anyway:"--anyway",wait:"--wait"};function Ez({t:e}){const n=pe(),s=Ke(),r=s.data?.ready?s.data.meta.engine==="live":!0,i=f1(e).filter(j=>!qo(j)),o=e.dependency?.way==="wait"&&!e.waiting,[l,u]=C.useState(o?null:"branch"),d=i.map(j=>j.id).join(" and ")||"it",p=i.length===1?i[0]:void 0,f=!!(r&&p&&!p.worktree&&!p.branch),m=[{way:"branch",label:p?`Build on ${p.id}'s work`:"Build on its work",note:`The copy starts from ${d}'s work so far. Once ${d} is merged, the newest work comes in and any clash is settled.`,off:p?f?`${p.id} has no code yet.`:void 0:"A copy can start from one ticket only."},{way:"anyway",label:"Build anyway",note:`From your team's code, without ${d}. This stays on the ticket's record.`},{way:"wait",label:"Wait",note:`Starts by itself when ${d} ${i.length>1?"are":"is"} merged.`,off:o?"This is what it does now.":void 0}],x=m.find(j=>j.way===l&&!j.off),y={branch:`Building on ${d}'s work`,anyway:`Building without ${d}`,wait:`It starts by itself once ${d} is merged`};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:o?t.jsx(ef,{size:15}):t.jsx(Jp,{size:15})}),t.jsxs("div",{children:[t.jsx(D,{as:"b",text:o?`Waits for ${d} to merge`:e.waiting?.summary??`${e.id} needs ${d}, which is not merged yet`}),t.jsx("span",{children:o?`It starts by itself once ${d} ${i.length>1?"are":"is"} merged. You can still build it another way.`:`Its design uses work from ${d}, which is not in the code yet. Choose how to build.`})]})]}),t.jsx("div",{className:"lbl",children:"What it needs"}),i.map(j=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:j.id}),t.jsx(D,{as:"b",text:j.title}),t.jsxs("span",{className:"pill wait",children:[_s[j.stage]," · not merged yet"]})]},j.id)),t.jsxs("div",{className:"lbl",children:["How to build ",e.id]}),t.jsx("div",{className:"opts2",style:{gridTemplateColumns:"1fr"},children:m.map(j=>t.jsxs("button",{className:`opt2 ${l===j.way&&!j.off?"pick":""}`,disabled:!!j.off,onClick:()=>u(j.way),children:[t.jsxs("b",{children:[j.label,l===j.way&&!j.off&&t.jsxs("span",{children:[t.jsx(ge,{size:13,strokeWidth:2.5})," Your pick"]})]}),j.off?`${j.note} ${j.off}`:j.note]},j.way))})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!x||n.isPending,onClick:()=>x&&n.mutate({path:`/api/v1/tickets/${e.id}/build`,body:{way:x.way},done:y[x.way]}),children:[x?.way==="wait"?t.jsx(ef,{size:15}):t.jsx(Jp,{size:15})," ",x?x.label:"Pick a way"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad build ${e.id} ${Tz[x?.way??"branch"]}`})]})]})}const Az={branch:e=>`Built on ${e}'s work. The newest work comes in once ${e} is merged.`,anyway:e=>`Built from your team's code without ${e}, as you chose.`,wait:e=>`Waits for ${e} to merge, then starts by itself.`};function Pz({t:e}){const n=f1(e);if(!e.dependsOn?.length)return null;const s=e.dependency;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Depends on"}),t.jsx("div",{className:"pills",children:e.dependsOn.map(r=>{const i=n.find(l=>l.id===r),o=!i||qo(i);return t.jsxs("span",{className:`pill ${o?"ok":"wait"}`,title:i?.title,children:[o&&t.jsx(dk,{size:13}),t.jsxs("span",{children:[r,i&&t.jsxs(t.Fragment,{children:[" ",t.jsx(D,{text:i.title})]})," · ",i?o?"merged":"not merged yet":"left the board"]})]},r)})}),s&&(s.way!=="wait"||!s.started)&&t.jsxs("p",{className:"note",style:{marginTop:6},children:[Az[s.way](s.on.join(" and "))," ",s.by," chose this."]})]})}function Rz({t:e}){const n=f1(e).filter(o=>!qo(o));if(!n.length||e.waiting?.kind==="depends"||qo(e))return null;const s=n.map(o=>o.id).join(", "),r=e.dependency,i=r?.way==="branch"?`On ${s}'s work`:r?.way==="wait"&&!r.started?`Waits for ${s}`:r?.way==="anyway"?`Without ${s}`:`Needs ${s}`;return t.jsx("span",{className:"prio owner",title:`Depends on ${s}, which is not merged yet`,children:i})}function Iz({t:e}){const n=pe(),s=Ke(),r=s.data?.ready?s.data.meta.engine!=="live":!1;if(!["implement","test","review"].includes(e.stage)||qo(e)||e.takenOver||e.waiting&&!["proof","stuck"].includes(e.waiting.kind))return null;const i=!e.waiting&&(e.live||!!e.squad);return t.jsxs("button",{className:"btn sm",disabled:!!e.baseWanted||n.isPending,title:`squad bring-in ${e.id}`,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/bring-in`,done:r?"The sample board has no code, so nothing changed":i?"The newest work comes in when this step ends, before the checks":"Bringing in the newest work"}),children:[t.jsx(dk,{size:13})," ",e.baseWanted?"The newest work comes in after this step":"Bring in the newest work"]})}function m1(e){const n=Ke(),s=n.data?.ready?n.data.meta.engine==="live":!0;return sR(e,s)}function Fw({t:e}){const n=pe(),s=pt[m1(e)],r=Gt(),i=sa(ra),o=()=>i?void r({to:"/conversations",search:{ticket:e.id}}):gs.show(e.id);return e.chat?.open?t.jsxs("button",{className:"btn sm askbtn",onClick:o,title:`The chat with the ${pt[e.chat.with]} is open`,children:[t.jsx(Bn,{size:14})," Open the chat"]}):t.jsxs("button",{className:"btn sm askbtn",disabled:n.isPending,title:`The ${s} answers. ${e.id} stays where it is.`,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{ask:!0}},{onSuccess:o}),children:[t.jsx(Bn,{size:14})," Ask a question"]})}const Fz=e=>(e??"").replace(/^https?:\/\//,"").replace(/\/$/,"");function zz(e){return $e({queryKey:["try",e],queryFn:()=>Se(`/api/v1/tickets/${encodeURIComponent(e)}/try`),refetchInterval:n=>n.state.data?.state==="starting"?1e3:4e3})}function g1({t:e}){const n=zz(e.id).data;return t.jsxs("div",{className:"yourcheck",children:[t.jsx(Lz,{t:e,s:n}),t.jsx(vz,{t:e}),t.jsx(Mz,{t:e,s:n})]})}function Lz({t:e,s:n}){const s=JP(e),r=pt[m1(e)];return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Where to look"}),s.length?t.jsx("ul",{className:"lookpages",children:s.map(i=>{const o=n?.state==="running"?n.pages?.find(u=>u.page===i)?.url:void 0,l=(e.proof??[]).filter(u=>fu(u).includes(i)).map(u=>u.criterion);return t.jsxs("li",{children:[t.jsx("code",{children:i}),t.jsx(D,{className:"what",text:l.join(" · ")}),o&&t.jsxs("a",{className:"btn sm",href:o,target:"_blank",rel:"noreferrer",title:`Open ${o}`,children:[t.jsx(xs,{size:13})," Open"]})]},i)})}):t.jsxs("p",{className:"note lookpages-none",children:["No page is saved for this story. Ask a question and the ",r," tells you where to look, or try it yourself."]})]})}function Mz({t:e,s:n}){const s=pe(),r=n?.state??"off",i=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try`,done:"Starting this story's own copy of the app"}),o=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try/stop`,done:"Stopped it."}),l=r==="running"||r==="starting";return t.jsxs("div",{className:`trybox ${r}`,children:[t.jsxs("div",{className:"trybox-row",children:[t.jsx("span",{className:"ring","aria-hidden":"true",children:r==="starting"?t.jsx(pn,{size:15,className:"spin"}):t.jsx(Sn,{size:14})}),t.jsxs("div",{className:"trybox-t",children:[t.jsx("b",{children:r==="running"?"Running":r==="starting"?"Starting…":"Try it yourself"}),t.jsxs("span",{children:["Runs this story's own copy of the app, with the change in it. Nothing is merged.",r==="running"&&n?.url?t.jsxs(t.Fragment,{children:[" ","At ",t.jsx("span",{className:"mono",children:Fz(n.url)}),"."]}):null]})]}),t.jsx("span",{className:"grow"}),t.jsxs("div",{className:"trybox-acts",children:[r==="running"&&n?.url&&t.jsxs("a",{className:"btn sm pri",href:n.url,target:"_blank",rel:"noreferrer",title:`Open ${n.url}`,children:[t.jsx(xs,{size:13})," Open"]}),l&&t.jsxs("button",{className:"btn sm",disabled:s.isPending,onClick:o,children:[t.jsx(is,{size:11})," Stop"]}),!l&&n?.can&&t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:i,children:r==="failed"?"Try again":"Try it yourself"})]})]}),r==="failed"&&t.jsx("p",{className:"trybox-why",children:n?.error??"The app did not start."}),r==="failed"&&n?.detail&&t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"See what failed"}),t.jsx("pre",{className:"app-out",children:n.detail})]}),!l&&n&&!n.can&&n.why&&t.jsx("p",{className:"trybox-why quiet",children:n.why}),!l&&n?.other&&n.can&&t.jsxs("p",{className:"trybox-why quiet",children:[n.other,"'s copy runs now. Trying this one stops it."]}),(l||n?.can)&&t.jsx(re,{text:l?`squad try ${e.id} --stop`:`squad try ${e.id}`})]})}function zw(){return C.useSyncExternalStore(MN,LN)}function Lw({id:e,onClose:n}){const s=Qo(e),r=la(),{ticketFull:i,toggleTicketFull:o}=Le(),[l,u]=C.useState(null),[d,p]=C.useState("now");C.useEffect(()=>p("now"),[e]),C.useEffect(()=>{const k=b=>b.key==="Escape"&&!document.querySelector(".modal")&&n();return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n]);const f=s.data,m=Ke(),x=m.data?.ready?m.data.meta.parts:void 0,y=m.data?.ready?m.data.meta.engine==="live":!1,j=f?.parts?.length?f.parts.map(k=>x?.find(b=>b.id===k)?.name??k):Yk(x,f?.repo);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"veil",onClick:n}),t.jsx("aside",{className:`drawer ${i?"full":""}`,"aria-label":f?`${f.id} ${f.title}`:"Ticket",children:f?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"dh",children:[t.jsxs("div",{className:"dtop",children:[t.jsx("span",{className:"idtag",children:f.id}),f.source.type!=="manual"&&(f.source.url?t.jsxs("a",{className:"src",href:f.source.url,target:"_blank",rel:"noreferrer",children:[t.jsx(ks,{size:14})," ",f.source.itemType??"Item"," ",f.source.ref," ",t.jsx(xs,{size:12})]}):t.jsxs("span",{className:"src",children:[t.jsx(ks,{size:14})," From ",f.source.ref]})),f.pr&&t.jsxs("a",{className:"src",href:f.pr.url,target:"_blank",rel:"noreferrer",children:[t.jsx(JN,{size:14})," Pull request ",f.pr.id," ",t.jsx(xs,{size:12})]}),f.kind==="bug"&&t.jsxs("span",{className:"prio",children:["Bug",f.foundIn?` found in ${f.foundIn}`:""]}),f.priority==="high"&&f.kind!=="bug"&&t.jsx("span",{className:"prio",children:"High priority"}),t.jsx(kR,{t:f}),t.jsx("span",{className:"grow"}),t.jsxs("span",{className:"dacts",children:[t.jsx(Fw,{t:f}),f.waiting?.kind==="proof"&&t.jsx(Ce,{to:"/tickets/$id/proof",params:{id:f.id},className:"iconbtn","aria-label":"Open the proof page",children:t.jsx(xs,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:()=>Go.open({ticket:f.id}),"aria-label":"Report a problem",title:"Report a problem",children:t.jsx(sm,{size:15})}),t.jsx(Nz,{t:f,onDeleted:n,items:[...(_n(f,r)||!r)&&Uu(f)&&!f.takenOver?.free?[{key:"propose",label:t.jsxs(t.Fragment,{children:[t.jsx(vs,{size:15})," ",Ds(f)?"Ask for a change…":"Propose a change…"]}),onPick:()=>u("propose")}]:[],...mR(f,r,y)?[{key:"outside",label:t.jsxs(t.Fragment,{children:[t.jsx(Ki,{size:15})," Work in another AI tool…"]}),onPick:()=>u("outside")}]:[],...dR(f,r)?[{key:"hand-over",label:t.jsxs(t.Fragment,{children:[t.jsx(nu,{size:15})," Hand over…"]}),onPick:()=>u("hand-over")}]:[]]}),t.jsx("button",{className:"iconbtn fullbtn",onClick:o,"aria-pressed":i,"aria-label":i?"Back to the side panel":"Full width",title:i?"Back to the side panel":"Full width",children:i?t.jsx(gk,{size:15}):t.jsx(Au,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:n,"aria-label":"Close",children:t.jsx(Qe,{size:16})})]})]}),l==="hand-over"&&t.jsx(hR,{t:f,onClose:()=>u(null)}),l==="outside"&&t.jsx(gR,{t:f,onClose:()=>u(null)}),l==="propose"&&t.jsx(ll,{t:f,onClose:()=>u(null)}),t.jsx(D,{as:"h2",text:f.title}),t.jsx(II,{t:f}),t.jsxs("div",{className:"sub",children:[t.jsxs("span",{children:["Created by ",t.jsx(D,{as:"b",text:f.createdBy})," ",St(f.createdAt)," · ",t.jsx(RI,{t:f})]}),t.jsxs("span",{children:["Owner ",t.jsx(D,{as:"b",text:al(f)}),_n(f,r)?" (you)":""]}),j.length>0&&t.jsxs("span",{children:[j.length>1?"Parts":"Part"," ",t.jsx(D,{as:"b",text:j.join(", ")})]}),f.builder&&t.jsxs("span",{children:["Builder ",t.jsx("b",{children:f.builder})]}),f.reviewer&&t.jsxs("span",{children:["Reviewer ",t.jsx("b",{children:f.reviewer})]})]}),t.jsx(L8,{ticket:f})]}),t.jsxs("div",{className:"tabs",role:"tablist",children:[[["now","Now"],["story","Story"],["plan","Plan"],["activity","Activity"],["conversation","Conversation"],["proof","Proof"],["changes","Changes"],["cost","Cost"]].map(([k,b])=>t.jsxs("button",{className:d===k?"on":"",onClick:()=>p(k),children:[b,k==="now"&&(f.waiting||f.outdated?.length||qs(f)||bs(f))&&t.jsx("span",{className:"dot"})]},k)),t.jsxs("button",{className:`dev ${d==="developer"?"on":""}`,onClick:()=>p("developer"),children:[t.jsx(Ho,{size:15})," Developer"]})]}),d==="now"&&f.outdated?.length?t.jsx(Yz,{t:f}):null,d==="now"&&bs(f)&&f.waiting?.kind!=="plan"&&(_n(f,r)||!r)?t.jsx(Sw,{t:f,banner:!0}):null,d==="now"&&t.jsx(pR,{t:f}),d==="now"&&t.jsx(Cz,{t:f,onDeleted:n}),d==="now"&&(_n(f,r)||!r)&&t.jsx(UR,{t:f}),d==="now"&&(_n(f,r)||!r?t.jsx(qz,{t:f},f.id):t.jsx(fR,{t:f})),d==="story"&&t.jsx(Jz,{t:f}),d==="plan"&&t.jsx(nL,{t:f}),d==="activity"&&t.jsx(sL,{t:f}),d==="conversation"&&t.jsx(VF,{t:f,onTab:p}),d==="proof"&&t.jsx(rL,{t:f}),d==="changes"&&t.jsx(NR,{t:f}),d==="cost"&&t.jsx("div",{className:"db",children:t.jsx(xF,{t:f})}),d==="developer"&&t.jsx(iL,{t:f})]}):t.jsx("div",{className:"center",children:s.isError?t.jsxs("div",{children:[t.jsx("p",{children:D8(s.error,e)}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}):"Loading…"})})]})}function qz({t:e}){if(!e.waiting&&e.quiet)return t.jsx(Kz,{t:e});if($z(e))return t.jsx(Ez,{t:e});switch(e.waiting?.kind){case"questions":return t.jsx(_z,{t:e});case"spec":case"plan":return t.jsx(Bz,{t:e});case"proof":return t.jsx(Hz,{t:e});case"stuck":return t.jsx(AR,{t:e,extra:t.jsxs(t.Fragment,{children:[t.jsx(ua,{t:e}),e.stuck?.gate==="proof"&&e.proof?.some(n=>n.after)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"What the screenshots show"}),t.jsx(y1,{t:e})]}),oa(e)&&t.jsx(g1,{t:e}),t.jsx(Qr,{t:e})]})});case"ask":return t.jsx(Vz,{t:e});case"yours":return e.takenOver?.free?t.jsx(yR,{t:e,extra:t.jsx(Qr,{t:e})}):t.jsx(Qz,{t:e});case"chat":return e.chat?t.jsx(Oz,{t:e}):t.jsx(zf,{t:e});default:return t.jsx(zf,{t:e})}}function Oz({t:e}){const n=pt[e.chat.with];return t.jsx("div",{className:"db",children:t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(Bn,{size:15})}),t.jsxs("div",{children:[t.jsxs("b",{children:["Talking it through with the ",n]}),t.jsx("span",{children:"The talk is open in the chat panel beside the board. Its work waits until you press a button there."})]}),t.jsx("span",{className:"grow"}),t.jsx(Ce,{to:"/conversations",search:{ticket:e.id},className:"btn sm",children:"Full screen"})]})})}function _z({t:e}){const n=pe(),s=Object.fromEntries((e.questions??[]).filter(x=>x.answer).map(x=>[x.id,x.answer])),[r,i,o]=Ne(e.id,"answers",s),[l,u]=C.useState(!1),d=Object.keys(r).length,p=e.questions??[],f=[{from:"analyst",label:"From the Analyst, about what to build"},{from:"architect",label:"From the Architect, about how to build it"}],m=p.every(x=>{const y=r[x.id];return y?y.choice===x.inputOption||y.choice==="Other"?!!y.value?.trim():!0:!1});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"db",children:f.map(x=>{const y=p.filter(j=>j.from===x.from);return y.length?t.jsxs("div",{className:"qblock",children:[t.jsxs("div",{className:"qgroup",children:[t.jsx(ni,{role:x.from,small:!0}),x.label]}),y.map(j=>t.jsx(Dz,{t:e,q:j,n:p.indexOf(j)+1,answer:r[j.id],onAnswer:k=>i(b=>({...b,[j.id]:k}))},j.id))]},x.from):null})}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!m||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/answers`,body:{answers:r},done:"Answers sent. The Architect is choosing the design."},{onSuccess:o}),children:[t.jsx(ws,{size:15})," Send answers"]}),t.jsx("button",{className:"btn",disabled:n.isPending,onClick:()=>{if(d>0&&!l)return u(!0);n.mutate({path:`/api/v1/tickets/${e.id}/skip`,done:"The squad made its own guesses. You will see them in the plan."},{onSuccess:o})},children:l?`Skip and lose your ${d===1?"answer":`${d} answers`}?`:"Skip, let the squad guess"}),l&&t.jsx("button",{className:"btn quiet",onClick:()=>u(!1),children:"Keep them"}),t.jsx(li,{t:e,agent:"analyst",label:"Talk it through instead"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad answer ${e.id}`})]})]})}function Dz({t:e,q:n,n:s,answer:r,onAnswer:i}){const o=pe(),[l,u]=Ne(e.id,`ask-${n.id}`,""),[d,p]=C.useState(!!l),f=()=>{l.trim()&&(o.mutate({path:`/api/v1/tickets/${e.id}/ask`,body:{questionId:n.id,text:l}}),u(""),p(!1))},m=[...n.options,"Other"];return t.jsxs("div",{className:"q",children:[t.jsxs("h4",{...De(n.text),children:[s,". ",t.jsx(Kt,{text:n.text,dir:ht(n.text).dir})]}),(n.thread?.length||n.thinking)&&t.jsxs("div",{className:"thread",dir:ht(n.text).dir,children:[n.thread?.map((x,y)=>t.jsxs("div",{className:`msg ${x.who==="you"?"":"squad"}`,children:[t.jsx("small",{children:x.who==="you"?"You":Ms[x.who]}),t.jsx(D,{as:"div",text:x.text})]},y)),n.thinking&&t.jsxs("div",{className:"msg squad",children:[t.jsx("small",{children:Ms[n.from]}),t.jsxs("span",{className:"typing","aria-label":"Writing a reply",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]})]}),t.jsx("div",{className:"choices",dir:ht(n.options.join(" ")).dir,children:m.map(x=>{const y=r?.choice===x,j=x===n.inputOption||x==="Other";return t.jsxs("div",{className:`choice ${y?"on":""}`,...De(x),role:"radio","aria-checked":y,tabIndex:0,onClick:()=>!y&&i({choice:x}),onKeyDown:k=>k.target===k.currentTarget&&k.key==="Enter"&&!y&&i({choice:x}),children:[t.jsx("span",{className:"rd"}),t.jsx(D,{text:x.replace(/:$/,"")}),j&&y&&t.jsx("input",{autoFocus:!0,dir:xe(r?.value??""),value:r?.value??"",placeholder:x==="Other"?"Your answer":"Which one?",onChange:k=>i({choice:x,value:k.target.value}),onClick:k=>k.stopPropagation()})]},x)})}),d?t.jsxs("div",{className:"askrow",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(l),value:l,onChange:x=>u(x.target.value),placeholder:`Ask the ${Ms[n.from]} about this question`,onKeyDown:x=>x.key==="Enter"&&f()}),t.jsx("button",{className:"btn",onClick:f,disabled:!l.trim(),children:"Ask"})]}):t.jsxs("button",{className:"asklink",onClick:()=>p(!0),disabled:n.thinking,children:[t.jsx(Bn,{size:14})," Ask about this"]})]})}function ju({t:e,review:n}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The story"}),t.jsx(Ac,{review:n,at:{part:"story"},dir:ht(e.story??"").dir,children:t.jsx(D,{as:"p",className:"story",text:e.story??""})}),e.criteria&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Done when"}),t.jsx("ol",{className:"ac",children:e.criteria.map((s,r)=>{const i=De(`${s.given} ${s.when} ${s.then}`);return t.jsx("li",{...i,children:t.jsx(Ac,{review:n,at:{part:"criterion",index:r},children:t.jsxs("span",{children:[t.jsx("em",{children:"Given"})," ",t.jsx(Kt,{text:s.given,dir:i.dir}),", ",t.jsx("em",{children:"when"})," ",t.jsx(Kt,{text:s.when,dir:i.dir}),", ",t.jsx("em",{children:"then"})," ",t.jsx(Kt,{text:s.then,dir:i.dir}),"."]})})},r)})})]}),e.decision&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["The Architect's decision ",e.decision.adr&&t.jsxs("span",{className:"pill ok",children:["Saved as ",e.decision.adr]})]}),t.jsx(Ac,{review:n,at:{part:"decision"},dir:ht(e.decision.title).dir,children:t.jsxs("div",{className:"decision",children:[t.jsxs("h3",{...De(e.decision.title),children:[t.jsx(ni,{role:"architect",small:!0}),t.jsx(D,{text:e.decision.title})]}),t.jsx("div",{className:"opts2",children:e.decision.options.map(s=>t.jsxs("div",{className:`opt2 ${s.chosen?"pick":""}`,...De(`${s.name} ${s.note}`),children:[t.jsxs("b",{children:[t.jsx(D,{text:s.name}),s.chosen&&t.jsxs("span",{children:[t.jsx(ge,{size:13,strokeWidth:2.5})," Chosen"]})]}),t.jsx(D,{text:s.note})]},s.name))}),t.jsxs("div",{className:"why",children:[t.jsx(D,{lead:t.jsx("b",{children:"Why"}),text:e.decision.why}),e.decision.clientCheck&&t.jsx(D,{lead:t.jsx("b",{children:"Client's choice"}),text:e.decision.clientCheck}),e.decision.replaces&&t.jsxs("span",{children:[t.jsx("b",{children:"Replaces"})," ",e.decision.replaces,". Once you approve, it is no longer a rule and later tickets follow this one."]})]})]})})]}),e.work&&e.follows&&e.follows.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Follows saved decisions"}),t.jsx("div",{className:"pills",children:e.follows.map(s=>t.jsx(Ce,{to:"/architecture",search:{adr:s},className:"pill",children:s},s))})]}),e.work&&t.jsx(Pz,{t:e}),e.mockup&&e.work&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"How it will look"}),t.jsx(Dm,{ticket:e.id,file:e.mockup,title:`${e.title}: mockup`})]}),e.work&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The work"}),t.jsxs("div",{className:"pills",children:[t.jsxs("span",{className:"pill",children:[e.work.steps," small steps"]}),t.jsxs("span",{className:"pill",children:[e.work.tests," new tests"]}),e.work.screens>0&&t.jsxs("span",{className:"pill",children:[e.work.screens," before and after screens"]})]})]}),e.work&&t.jsx(Sw,{t:e}),n&&e.steps&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Build steps"}),t.jsx("ol",{className:"ac",children:e.steps.map((s,r)=>t.jsx("li",{...De(s.title),children:t.jsx(Ac,{review:n,at:{part:"step",index:r},children:t.jsx(D,{text:s.title})})},r))})]})]})}function Bz({t:e}){const n=pe(),s=`plan-${e.waiting?.kind??"plan"}`,[r,i,o]=Ne(e.id,`${s}-mode`,null),[l,u,d]=Ne(e.id,`${s}-note`,""),[p,f]=C.useState(!1),[m,x,y]=Ne(e.id,`${s}-comments`,[]),j=()=>{o(),d(),y()},k=e.waiting?.kind==="spec",b=!k&&!!e.specApproved,S=k?"the Analyst":b?"the Architect":"the Spec writer",N={t:e,comments:m,add:R=>x(E=>[...E,R]),remove:R=>x(E=>E.filter((M,F)=>F!==R)),canEdit:R=>k?R.part==="story"||R.part==="criterion":R.part==="step"||!b&&(R.part==="story"||R.part==="criterion")},$=()=>r==="over"?n.mutate({path:`/api/v1/tickets/${e.id}/plan/start-over`,body:{direction:l},done:`Starting over. ${S[0].toUpperCase()}${S.slice(1)} writes it again.`},{onSuccess:j}):n.mutate({path:`/api/v1/tickets/${e.id}/change`,body:{text:l},done:`Sent to ${S}.`},{onSuccess:j}),A=m.length;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[(k||b)&&t.jsxs("div",{className:"twostep",children:[t.jsxs("span",{className:k?"on":"done",children:[k?"1":t.jsx(ge,{size:12,strokeWidth:3})," The what"]}),t.jsx("span",{className:"bar"}),t.jsx("span",{className:b?"on":"",children:"2 The how"}),t.jsx("p",{children:k?'Is this what you want? Check the story and the "done when" list. The Architect designs how to build it after you approve.':`The spec was approved by ${e.specApproved.by}. Now check how the Architect will build it. A developer can approve this part for you.`})]}),t.jsx(oz,{t:e}),t.jsx("p",{className:"note reviewhint",children:"Point at any part to comment on it or edit it yourself. Send back sends every comment at once."}),k?t.jsx(ju,{t:{...e,decision:void 0,work:void 0},review:N}):t.jsx(ju,{t:e,review:N}),!k&&e.decision&&t.jsx("p",{className:"note",style:{marginTop:14},children:"Approved decisions are saved in Decisions. Later tickets must follow them."})]}),r?t.jsxs("div",{className:"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,dir:xe(l),value:l,onChange:R=>u(R.target.value),placeholder:r==="over"?"What is the new direction? It is written again from zero.":"What should change? One line is enough.",onKeyDown:R=>R.key==="Enter"&&l.trim()&&!n.isPending&&$()}),t.jsx("button",{className:"btn pri",disabled:!l.trim()||n.isPending,onClick:$,children:r==="over"?"Start over":"Send"}),t.jsx("button",{className:"btn",onClick:()=>i(null),children:"Cancel"})]}):t.jsxs("div",{className:"df",children:[A>0?t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/plan/send-back`,body:{comments:m},done:`Sent back to ${S} with ${A} ${A===1?"comment":"comments"}.`},{onSuccess:j}),children:[t.jsx(ws,{size:15})," Send back (",A,")"]}):t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/approve`,done:k?"Spec approved. The Architect is designing how to build it.":"Plan approved. The Builder started."},{onSuccess:j}),children:[t.jsx(ge,{size:15,strokeWidth:2.5})," ",k?"Approve spec":b?"Approve design":"Approve plan"]}),A===0&&t.jsx("button",{className:"btn",onClick:()=>i("change"),children:"Change something"}),(k||b)&&t.jsx(li,{t:e,agent:k?"analyst":"architect",label:"Talk it through"}),t.jsx("button",{className:"btn quiet",onClick:()=>i("over"),children:"Start over"}),t.jsx("button",{className:"btn quiet",onClick:()=>f(!0),children:"Ask a developer"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:A>0?`squad send-back ${e.id} ${m.map(R=>Me(`${Wz(R)}: ${R.text}`)).join(" ")}`:`squad approve ${e.id}`})]}),p&&t.jsx(Uz,{t:e,onClose:()=>f(!1)})]})}function Wz(e){return e.part==="criterion"?`done when ${(e.index??0)+1}`:e.part==="step"?`step ${(e.index??0)+1}`:e.part}function Uz({t:e,onClose:n}){const{toast:s}=Le(),r=`Hi, can you check the plan for ${e.id} "${e.title}" before I approve it? It's on the board, or run: squad show ${e.id}`;return t.jsxs(He,{title:"Ask a developer",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:()=>void navigator.clipboard?.writeText(r).then(()=>s("Message copied")),children:[t.jsx(os,{size:15})," Copy message"]}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}),children:[t.jsx("p",{children:"Send this to a developer on your team. They can read the plan in the terminal and tell you what they think."}),t.jsx(D,{as:"div",className:"wa",text:r})]})}function x1({t:e}){const n=e.gates;return e.outside&&e.waiting?.kind==="proof"&&Gu(n)?t.jsxs("div",{className:"pills",children:[t.jsx(es,{state:"pending",text:"Checks not run"}),t.jsx(es,{state:"pending",text:"No review"}),t.jsx(es,{state:"pending",text:"No proof"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pills",children:[t.jsx(es,{state:n?.checks,text:Cw(n)}),t.jsx(es,{state:n?.review,text:n?.review==="pass"?`Review approved by ${n.reviewBy}`:n?.review==="skipped"?"Review notes open, you continued":"Review approved"}),t.jsx(es,{state:n?.proof,text:$w(e)})]}),t.jsx(Ew,{g:n}),e.overrides?.map(s=>t.jsxs("p",{className:"note override",children:[t.jsx("b",{children:"Continued anyway"})," past the ",gz(s),", by ",t.jsx(D,{text:s.by}),": ",t.jsx(D,{text:s.reason})]},s.at))]})}function y1({t:e}){const[n,s]=C.useState(null);if(!e.proof?.length)return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",children:Tw(e)}),t.jsx(If,{t:e})]});const{pictures:r,starts:i}=Aw(e.proof,o=>ss(`/api/v1/proof/${o}`));return t.jsxs(t.Fragment,{children:[n!==null&&t.jsx(oi,{pictures:r,start:n,onClose:()=>s(null)}),e.proof.map((o,l)=>t.jsxs("div",{className:`critrow ${p1(o.shows)}`,children:[t.jsxs("h5",{...De(o.criterion),children:[t.jsx(Pw,{shows:o.shows}),t.jsx(D,{text:o.criterion}),t.jsx(Rf,{shows:o.shows})]}),Lo(o)&&t.jsx(D,{as:"p",className:"verdictnote",text:Lo(o)}),Gr(o)&&t.jsxs("p",{className:"critpage",children:["Page ",t.jsx("code",{children:Gr(o)})]}),Mo(o.after)?t.jsx(u1,{file:o.after,...o.note?{note:o.note}:{}}):t.jsxs("div",{className:"proofmini",children:[t.jsxs("div",{children:[t.jsx(D,{as:"small",text:o.beforeLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(i[l]),"aria-label":`Open ${o.beforeLabel} full size`,children:t.jsx("img",{src:ss(`/api/v1/proof/${o.before}`),alt:`${o.criterion}, ${o.beforeLabel}`})})]}),t.jsxs("div",{children:[t.jsx(D,{as:"small",text:o.afterLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(i[l]+1),"aria-label":`Open ${o.afterLabel} full size`,children:t.jsx("img",{src:ss(`/api/v1/proof/${o.after}`),alt:`${o.criterion}, ${o.afterLabel}`})})]})]}),o.more?.length&&o.why&&o.note?t.jsx(D,{as:"p",className:"note proofmore-main",text:o.note}):null,t.jsx(Rw,{shot:o,first:i[l]+2,onOpen:s})]},o.criterion)),t.jsx(If,{t:e})]})}function Mw({t:e,sticky:n}){const s=pe(),[r,i,o]=Ne(e.id,"proof-wrong",""),[l,u]=C.useState(!!r),d=()=>{s.isPending||s.mutate({path:`/api/v1/tickets/${e.id}/change`,body:{text:r},done:"Sent back to the Builder with your note."},{onSuccess:o})};return l?t.jsxs("div",{className:n?"stickybar":"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,dir:xe(r),value:r,onChange:p=>i(p.target.value),placeholder:"What's wrong? Tell the squad in one line.",onKeyDown:p=>p.key==="Enter"&&r.trim()&&d()}),t.jsx("button",{className:"btn pri",disabled:!r.trim()||s.isPending,onClick:d,children:"Send back"}),t.jsx("button",{className:"btn",onClick:()=>u(!1),children:"Cancel"})]}):t.jsxs("div",{className:n?"stickybar":"df",children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/approve`,done:`${e.id} is ready to release.`}),children:[t.jsx(ge,{size:15,strokeWidth:2.5})," Looks right"]}),t.jsx("button",{className:"btn",onClick:()=>u(!0),children:"Something's wrong"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad approve ${e.id}`})]})}function Hz({t:e}){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(ge,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Check that it works the way you want"}),t.jsx("span",{children:mz(e.gates)})]}),t.jsx("span",{className:"grow"}),t.jsxs(Ce,{to:"/tickets/$id/proof",params:{id:e.id},className:"btn sm",children:[t.jsx(xs,{size:14})," Full page"]})]}),t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(x1,{t:e}),t.jsx(ua,{t:e}),t.jsx("div",{className:"lbl",children:"Before and after"}),t.jsx(y1,{t:e}),t.jsx(g1,{t:e})]}),t.jsx(Mw,{t:e})]})}const Ep="Decide yourself: take the simplest choice that fits the plan, and say what you chose";function Vz({t:e}){const n=pe(),s=e.agentQuestion,[r,i,o]=Ne(e.id,"agent-pick",null),[l,u,d]=Ne(e.id,"agent-own","");if(!s)return t.jsx(zf,{t:e});if(s.port)return t.jsx(pz,{t:e});if(s.kind)return t.jsx(LI,{t:e,extra:t.jsxs(t.Fragment,{children:[t.jsx(ua,{t:e}),t.jsx(Qr,{t:e})]})});const p={architect:"Architect",builder:"Builder",reviewer:"Reviewer"}[s.from],f=r===""?l.trim():r,m=[...s.options,Ep];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:"?"}),t.jsxs("div",{children:[t.jsxs("b",{children:["The ",p," has a question"]}),t.jsx("span",{children:"It stopped instead of guessing. Your answer goes back into the same conversation, and the work carries on."})]})]}),t.jsxs("div",{className:"lbl",children:[p," asks"]}),t.jsx(D,{as:"p",className:"stuckq",text:s.text}),s.why&&t.jsx(D,{as:"p",className:"note",style:{marginTop:-4},lead:"Why it matters:",text:s.why}),s.files&&s.files.length>0&&t.jsx(xb,{ticket:e.id,files:s.files}),t.jsxs("div",{className:"opts2",children:[m.map(x=>t.jsxs("button",{className:`opt2 ${r===x?"pick":""}`,...De(x),onClick:()=>i(x),children:[t.jsxs("b",{children:[t.jsx(D,{text:x===Ep?"Let it decide":x}),r===x&&t.jsxs("span",{children:[t.jsx(ge,{size:13,strokeWidth:2.5})," Your pick"]})]}),x===Ep?"It takes the simplest choice that fits the plan and tells you which.":""]},x)),t.jsx("button",{className:`opt2 ${r===""?"pick":""}`,onClick:()=>i(""),children:t.jsx("b",{children:"Write my own answer"})})]}),r===""&&t.jsx("textarea",{className:"input",rows:3,style:{width:"100%",marginTop:8},autoFocus:!0,dir:xe(l),value:l,placeholder:"Your answer",onChange:x=>u(x.target.value)}),t.jsx(Qr,{t:e})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!f||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:f},done:`Sent. The ${p} carries on.`},{onSuccess:()=>{o(),d()}}),children:[t.jsx(ws,{size:15})," Send answer"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad reply ${e.id}${f?` ${Me(f.length>40?`${f.slice(0,40)}…`:f)}`:""}`})]})]})}function Kz({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx(uz,{t:e}),e.now&&t.jsx(bw,{t:e}),t.jsx(ww,{t:e}),t.jsx(Nw,{t:e})]})}function Yz({t:e}){const n=pe(),[s,r]=C.useState(null),[i,o,l]=Ne(e.id,"keep-reason",""),u=!!e.mergedAt||e.stage==="done";return t.jsx("div",{className:"outdated",children:e.outdated.map(d=>t.jsxs("div",{className:"outdated-item",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:t.jsx(kr,{size:15})}),t.jsxs("b",{children:[t.jsx(Ce,{to:"/architecture",search:{adr:d.adr},children:d.adr})," came after this plan and changes it"]})]}),t.jsx(D,{as:"p",text:d.why}),t.jsx(D,{as:"p",lead:t.jsx("span",{className:"note",children:u?"What a follow-up would change:":"What would change:"}),text:d.change}),s===d.adr?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(i),value:i,onChange:p=>o(p.target.value),placeholder:"Why the plan stays as it is"}),t.jsx("button",{className:"btn sm",disabled:!i.trim()||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/decision-update`,body:{adr:d.adr,do:"keep",reason:i},done:"Kept the plan. The reason is on the ticket."},{onSuccess:()=>{r(null),l()}}),children:"Keep it"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>r(null),children:"Cancel"})]}):t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/decision-update`,body:{adr:d.adr,do:"update"},done:u?"Made a follow-up ticket.":"The Architect is updating the plan."}),children:u?"Make a follow-up ticket":"Update the plan"}),t.jsx("button",{className:"btn sm",onClick:()=>{r(d.adr),o("")},children:"Keep it as is"})]})]},d.adr))})}function Gz({t:e}){const n=pe(),s=e.localSetup,r=s.status==="pending"||s.status==="running";return t.jsxs("div",{className:`localsetup ${s.status}`,children:[t.jsx("span",{className:"ic",children:r?t.jsx(pn,{size:15,className:"spin"}):s.status==="done"?t.jsx(ge,{size:15,strokeWidth:2.5}):t.jsx(kr,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:r?"Updating your copy of the code":s.status==="done"?"Your copy of the code is ready to run":"Your copy of the code needs a hand"}),t.jsx("span",{children:r?"The merge changed your own folder, so the squad installs new packages and runs the database changes there.":s.status==="done"?`New packages and database changes are in your own folder${s.at?`, ${St(s.at)}`:""}${s.seconds!==void 0?` (${s.seconds} s)`:""}.`:"squad-kit could not finish setting it up. Try again, or ask an engineer to look at what failed."}),s.status==="failed"&&t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"See what failed"}),t.jsx("code",{children:s.command}),s.output&&t.jsx("pre",{children:s.output})]})]}),s.status==="failed"&&t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/local-setup`,done:"Running the setup again"}),children:"Try again"})]})}function zf({t:e}){const n=zw(),s=la(),r=pe(),i=m1(e),o=e.stage==="release"?/^Waits to merge\b/.test(e.status)?{title:"Waits to merge",text:"Your own copy of the code has changes in the same files. Save or undo them there, and it goes in by itself. squad-kit tries again every few minutes."}:{title:`Ready for ${e.release}`,text:"It goes out with the next release. Nothing needed from you until then."}:e.stage==="done"?{title:e.status,text:"This ticket is live. Found a problem? Report a bug and it comes back around."}:e.waiting?.kind==="change"?{title:"The Builder paused for your change",text:"The Architect updated the design. Approve it above, or decline the change and the Builder carries on."}:{title:"Nothing needed from you",text:`${Zz(e)} You'll get a card when the squad needs you.`},l=kw(e);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[l?t.jsx(bw,{t:e}):t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:e.stage==="release"?t.jsx(js,{size:18}):t.jsx(ge,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx(D,{as:"b",text:o.title}),t.jsx(D,{text:o.text})]}),e.stage==="release"&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"grow",style:{flex:1}}),t.jsx(Ce,{to:"/releases",className:"btn sm",children:"Open release"})]})]}),e.localSetup&&t.jsx(Gz,{t:e}),e.steps&&e.steps.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Steps"}),t.jsx(qw,{t:e})]}),e.gates&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(x1,{t:e})]}),t.jsx(ua,{t:e}),(e.stage==="release"||e.stage==="done")&&e.usage?.length?t.jsx(fF,{t:e}):null,t.jsx(e1,{t:e}),l?t.jsx(ww,{t:e}):t.jsx(Qr,{t:e}),t.jsx(Nw,{t:e})]}),t.jsxs("div",{className:"df",children:[e.live&&e.stage!=="release"&&e.stage!=="done"&&t.jsxs("button",{className:"btn sm",disabled:e.stopRequested||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping the squad"}),children:[t.jsx(is,{size:12})," ",e.stopRequested?"Stopping…":"Stop"]}),Gm(e)&&t.jsx(Qm,{t:e}),t.jsx(Iz,{t:e}),!e.chat?.open&&!e.takenOver&&!Ds(e)&&i!=="analyst"&&t.jsx(li,{t:e,agent:"analyst",label:"Ask the Analyst"}),(_n(e,s)||!s)&&t.jsx(HR,{t:e}),t.jsx("span",{className:"note",children:e.live?n==="down"?"Not updating: squad-kit has stopped.":"Updates live as the squad works.":""}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:e.live&&e.stage!=="release"?`squad stop ${e.id}`:dm(e)})]})]})}function Qz({t:e}){const n=pe(),[s,r,i]=Ne(e.id,"give-back",""),o=e.takenOver;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(Ho,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:"You have this ticket"}),t.jsx("span",{children:"The squad stopped and waits. Nothing runs until you give it back."})]})]}),t.jsx("div",{className:"lbl",children:"1. Open the Builder's session in Claude Code"}),t.jsx(re,{text:`cd ${Me(o.cwd)} && claude --resume ${o.session}`}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:6},children:"It is the same conversation the Builder had, in the ticket's own copy of the code. Your folder is not touched. Or just edit the files:"}),t.jsx(Bu,{t:e}),t.jsx("div",{className:"lbl",children:"2. Give it back"}),t.jsx("textarea",{className:"waynote",rows:2,dir:xe(s),value:s,onChange:l=>r(l.target.value),placeholder:"What did you change? (optional, every agent reads it)"}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"Then squad-kit runs the checks, the Reviewer reads all the changes, yours too, and the Tester makes the proof again."}),t.jsx(Qr,{t:e})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/give-back`,body:{note:s},done:"Given back. The checks run on your changes."},{onSuccess:i}),children:[t.jsx(ge,{size:15,strokeWidth:2.5})," Give back"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad give-back ${e.id}${s.trim()?` ${Me(s.trim())}`:""}`})]})]})}function Zz(e){const n=e.steps??[],s=n.findIndex(r=>r.status==="doing");return e.stage==="implement"&&s>=0?`The Builder is on step ${s+1} of ${n.length}.`:e.stage==="test"?"squad-kit is running the project checks.":e.stage==="review"?"The Reviewer is checking the work.":e.stage==="tickets"?"The Analyst is reading the ticket.":e.stage==="specs"?"The Architect is writing the plan.":`${e.status}.`}function qw({t:e}){return t.jsx("ul",{className:"steps",children:e.steps.map((n,s)=>t.jsxs("li",{className:n.status==="doing"?"now":n.status==="todo"?"todo":"",...De(n.title),children:[t.jsx("span",{className:`sd ${n.status==="done"?"ok":n.status==="doing"?"now":""}`,children:n.status==="done"&&t.jsx(ge,{size:11,strokeWidth:3})}),t.jsxs("span",{children:[t.jsx(D,{as:n.status==="doing"?"b":"span",style:n.status==="doing"?{fontWeight:600}:void 0,text:n.title}),n.live&&t.jsxs("span",{className:"livetxt",children:[t.jsx("span",{className:"live"}),t.jsx(D,{text:n.live})]})]}),t.jsx("span",{className:"time",dir:"ltr",children:n.status==="done"?`${n.minutes??1} min`:n.status==="doing"?"now":""})]},s))})}const Xz=/^(Reading|Running|Editing|Writing|Looking|Searching|Listing|Runs on|Started step|Finished step|Stopped a program|Setting up squad-kit's screenshot browser)\b|^squad-kit (asked|ran|started|stopped|is running)\b/;function Qr({t:e,all:n}){const[s,r]=C.useState(!1),i=e.activity.filter(l=>!Xz.test(l.text)),o=n?s?e.activity:i:i.slice(0,4);return!o.length&&!(n&&e.activity.length)?null:t.jsxs(t.Fragment,{children:[!n&&t.jsx("div",{className:"lbl",children:"Latest activity"}),t.jsx("div",{className:"feed",children:o.map((l,u)=>t.jsxs("div",{className:"fe",children:[t.jsx("span",{className:"tm",children:Wn(l.at)}),t.jsx(ni,{role:l.who,small:!0}),t.jsx(D,{lead:t.jsx("b",{children:Ms[l.who]}),text:l.text.charAt(0).toLowerCase()+l.text.slice(1)})]},l.at+u))}),n&&i.length<e.activity.length&&t.jsx("button",{className:"btn sm ghost",onClick:()=>r(l=>!l),children:s?"Show only what matters":"Show every step"})]})}function Jz({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx("div",{className:"lbl",children:"What was asked"}),t.jsx(um,{as:"p",className:"story",style:{whiteSpace:"pre-wrap"},text:e.ask}),t.jsx(Pp,{head:"Your acceptance criteria",items:e.brief?.criteria}),t.jsx(Pp,{head:"Business rules",items:e.brief?.rules}),t.jsx(Pp,{head:"Edge cases",items:e.brief?.edgeCases}),t.jsx(tL,{t:e}),t.jsx(eL,{t:e}),t.jsx(KR,{t:e}),t.jsx(e1,{t:e}),e.story?t.jsx(ju,{t:{...e,decision:void 0,work:void 0}}):t.jsx("p",{className:"note",style:{marginTop:16},children:"The Analyst writes the user story after your answers."})]})}const Ap=[{kind:"note",label:"Note",head:"Note",hint:"Anything the squad should know"},{kind:"rule",label:"Business rule",head:"Rule",hint:"For example: at most 3 bookings a day per person"},{kind:"criterion",label:"Acceptance criterion",head:"Done when",hint:"The Tester must prove it, for example: the clerk sees an error on the 4th booking"}];function eL({t:e}){const n=pe(),[s,r]=C.useState("note"),[i,o]=Ne(e.id,"note",""),l=e.notes??[],u=e.stage!=="done",d=Ap.find(f=>f.kind===s),p=()=>{!i.trim()||n.isPending||n.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:i,kind:s},done:e.live?"Added. The squad reads it at its next step.":"Added. Every agent on this ticket reads it."},{onSuccess:()=>o("")})};return!u&&!l.length?null:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Notes",l.length?` · ${l.length}`:""]}),l.length>0&&t.jsx("ul",{className:"ticketnotes",children:l.map((f,m)=>t.jsxs("li",{...De(f.text),children:[t.jsx("span",{className:`pill ${f.kind==="criterion"?"ok":f.kind==="rule"?"wait":""}`,children:Ap.find(x=>x.kind===f.kind)?.head}),t.jsx(D,{className:"grow",text:f.text}),t.jsxs("span",{className:"note",dir:"ltr",children:[t.jsx(D,{text:f.by})," · ",St(f.at)]})]},m))}),u&&t.jsxs("div",{className:"addnote",children:[t.jsx("div",{className:"seg",style:{width:"fit-content"},children:Ap.map(f=>t.jsx("button",{className:s===f.kind?"on":"",onClick:()=>r(f.kind),children:f.label},f.kind))}),t.jsx("textarea",{className:"input",rows:2,dir:xe(i),value:i,placeholder:d.hint,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&i.trim()&&p()}}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[t.jsxs("button",{className:"btn pri sm",disabled:!i.trim()||n.isPending,onClick:p,children:["Add ",d.label.toLowerCase()]}),t.jsxs("span",{className:"note",children:["Every agent on this ticket reads it",e.live?", the one working now from its next step":"","."]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad note ${e.id}${s==="note"?"":` --${s}`} ${Me(i.trim()||"…")}`})]})]})]})}function Pp({head:e,items:n}){return n?.length?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:e}),t.jsx("ul",{className:"brief",children:n.map((s,r)=>t.jsx(D,{as:"li",text:s},r))})]}):null}const H2=/\.(png|jpe?g|gif|webp|bmp)$/i;function tL({t:e}){const[n,s]=C.useState(null),r=e.attachments??[];if(!r.length)return null;const i=u=>u.split(/[\\/]/).pop()??u,o=r.filter(u=>H2.test(u)).map(u=>({src:wn(e.id,u),caption:i(u)})),l=r.filter(u=>!H2.test(u));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Attached · ",r.length]}),o.length>0&&t.jsx("div",{className:"thumbs",children:o.map((u,d)=>t.jsx("button",{className:"zoom thumb",onClick:()=>s(d),"aria-label":`Open ${u.caption} full size`,children:t.jsx("img",{src:u.src,alt:u.caption,loading:"lazy"})},u.src))}),l.map(u=>t.jsx("a",{className:"filechip mono",href:wn(e.id,u),target:"_blank",rel:"noreferrer",children:i(u)},u)),n!==null&&t.jsx(oi,{pictures:o,start:n,onClose:()=>s(null)})]})}function nL({t:e}){return e.story?t.jsxs("div",{className:"db",children:[t.jsx(ju,{t:e}),e.steps&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Steps"}),t.jsx(qw,{t:e})]})]}):t.jsx("div",{className:"db",children:t.jsx("p",{className:"note",children:"The plan is written after the questions are answered."})})}function sL({t:e}){return t.jsx("div",{className:"db",children:t.jsx(Qr,{t:e,all:!0})})}function rL({t:e}){return e.gates?t.jsxs("div",{className:"db",children:[t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(x1,{t:e}),t.jsx(ua,{t:e}),t.jsx("div",{className:"lbl",children:"Before and after"}),e.gates.proof==="pass"||e.proof?.some(n=>n.shows)?t.jsx(y1,{t:e}):t.jsx("p",{className:"note",children:"The screens are recorded after all checks pass."})]}):t.jsx("div",{className:"db",children:t.jsx("p",{className:"note",children:"The Tester records the proof after the Builder finishes."})})}function iL({t:e}){const n=C.useMemo(()=>{const s=new Set,r=[...e.activity.map(i=>i.text),...(e.steps??[]).map(i=>i.live??"")];for(const i of r)for(const o of i.matchAll(/[\w./-]+\/[\w.-]+\.\w+/g))s.add(o[0]);return[...s]},[e]);return t.jsxs("div",{className:"db",children:[t.jsx(PR,{t:e}),t.jsx("div",{className:"lbl",children:"Branch"}),t.jsxs("p",{className:"mono",style:{fontSize:13},children:[e.repo?`${e.repo}: `:"",e.branch??`squad/${e.id.toLowerCase()}`]}),e.worktree&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The ticket's copy of the code"}),t.jsx("p",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:e.storyDir??e.worktree}),t.jsx(Bu,{t:e})]}),e.gates?.ran?.length?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The checks that ran"}),t.jsx("div",{className:"feed",children:e.gates.ran.map(s=>t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[s.name,": ",s.command," (",s.failedOnce?"failed once, passed when run again":s.ok?"passed":"failed",")"]},s.name))})]}):null,e.testChange||e.testDecided?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"How the tests run"}),t.jsxs("div",{className:"feed",children:[e.testDecided&&t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.testDecided.kept==="new"?`Kept the new one: ${e.testDecided.to} (was ${e.testDecided.from})`:`Kept the current one: ${e.testDecided.from} (not ${e.testDecided.to})`,", by ",e.testDecided.by==="you"?"you":"squad-kit",e.testDecided.ran?`. ${e.testDecided.ran}`:""]}),e.testChange&&t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.testChange.ask?"Waiting for a choice":"Tried at the next checks",": ",e.testChange.from," or ",e.testChange.to,e.testChange.ran?`. ${e.testChange.ran}`:""]})]})]}):null,e.localSetup&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Setting up your own copy"}),t.jsxs("p",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.localSetup.command," in ",e.localSetup.dir," (",e.localSetup.status,")"]})]}),t.jsx("div",{className:"lbl",children:"Files the squad touched"}),n.length?t.jsx("div",{className:"feed",children:n.map(s=>t.jsx("div",{className:"mono",style:{fontSize:12.5},children:s},s))}):t.jsx("p",{className:"note",children:"No files changed yet."}),t.jsx("div",{className:"lbl",children:"In the terminal"}),t.jsxs("div",{className:"pills",children:[t.jsx(re,{text:`squad show ${e.id}`}),t.jsx(re,{text:`squad watch ${e.id}`})]})]})}const aL=[{stage:"tickets",role:"analyst",who:"Analyst"},{stage:"specs",role:"architect",who:"Architect"},{stage:"implement",role:"builder",who:"Builder"},{stage:"test",role:"tester",who:"Tester"},{stage:"review",role:"reviewer",who:"Reviewer"},{stage:"release",role:"release",who:"Release"},{stage:"bugs",role:"triage",who:"Triage"}];function oL(){const e=Ke(),n=DF(),s=ei({from:"/board"}),r=Gt({from:"/board"}),[i,o]=C.useState(null),[l,u]=C.useState(""),[d,p]=C.useState(!1),f=$e({queryKey:["ticket-draft-current"],queryFn:()=>Se("/api/v1/tickets/draft/current"),enabled:i!=="new",refetchInterval:N=>N.state.data?.draft?.status==="working"?2e3:3e4}),m={working:"drafting…",done:"draft ready",failed:"draft stopped",cancelled:""}[f.data?.draft?.status??"cancelled"];C.useEffect(()=>{s.write&&(o("new"),r({search:N=>({...N,write:void 0}),replace:!0}))},[s.write,r]);const x=s.view??"all",y=N=>void r({search:$=>({...$,ticket:N})}),j=()=>void r({search:N=>({...N,ticket:void 0})}),k=e.data?.ready?e.data:null,b=C.useMemo(()=>{const N=[...k?.tickets??[],...d?k?.archived??[]:[]],$=l.trim().toLowerCase();return N.filter(A=>x==="bugs"&&A.kind!=="bug"||x==="mine"&&!_n(A,k?.meta.user?.name)?!1:!$||A.title.toLowerCase().includes($)||A.id.toLowerCase().includes($))},[k,l,x,d]);if(e.isLoading)return t.jsx("div",{className:"center",children:"Loading the board…"});if(e.isError&&!e.data)return t.jsx(So,{what:"the board",error:e.error,onRetry:()=>void e.refetch()});if(!k)return t.jsx(uL,{settings:e.data?.settings});const S=k.tickets.filter(Xo);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Board"}),t.jsx("div",{className:"seg",role:"tablist",children:["all","mine","bugs"].map(N=>t.jsx("button",{className:x===N?"on":"",onClick:()=>void r({search:$=>({...$,view:N==="all"?void 0:N})}),children:N==="all"?"All tickets":N==="mine"?"Mine":"Bugs"},N))}),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"search",children:[t.jsx(ti,{size:15}),t.jsx("input",{dir:xe(l),value:l,onChange:N=>u(N.target.value),placeholder:"Search tickets","aria-label":"Search tickets"})]}),t.jsx(cL,{onPull:()=>o("pull")}),t.jsxs("button",{className:"btn pri",onClick:()=>o("new"),children:[t.jsx(Nt,{size:15})," New ticket",m&&t.jsx("span",{className:"btn-tag",children:m})]})]}),(n||S.length===0)&&t.jsxs("section",{className:"waiting","aria-label":"Waiting for you",children:[t.jsxs("div",{className:"wh",children:[t.jsx("h2",{children:"Waiting for you"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad inbox"})]}),n?t.jsx(gw,{}):k.meta.engine==="live"&&k.tickets.length===0?t.jsxs("div",{className:"calmlane",children:[t.jsx("span",{className:"glyph",children:t.jsx(Nt,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsx("b",{children:"Start with your first ticket."})," Write what you want in plain words. The squad asks what it needs to know."]}),t.jsx("span",{className:"grow",style:{flex:1}}),t.jsxs("button",{className:"btn pri sm",onClick:()=>o("new"),children:[t.jsx(Nt,{size:14})," New ticket"]})]}):t.jsxs("div",{className:"calmlane",children:[t.jsx("span",{className:"glyph",children:t.jsx(ge,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsx("b",{children:"Nothing needs you right now."})," The squad is working. New questions and approvals show up at the top of every page."]})]})]}),(k.broken?.length??0)>0&&t.jsx(Oo,{list:k.broken}),(k.brokenRecords?.length??0)>0&&t.jsx(Oo,{list:k.brokenRecords,label:"Files that could not be read"}),t.jsx(a7,{tickets:k.tickets,archived:k.archived??[],live:k.meta.engine==="live",project:k.meta.project,onOpen:y}),t.jsx("div",{className:"board",children:aL.map(N=>{const $=b.filter(A=>A.stage===N.stage);return t.jsxs("section",{className:"lane","aria-label":_s[N.stage],children:[t.jsxs("div",{className:"lh",children:[t.jsx(ni,{role:N.role}),t.jsxs("span",{className:"t",children:[t.jsx("b",{children:_s[N.stage]}),t.jsx("small",{children:N.who})]}),t.jsx("span",{className:"n",children:$.length})]}),$.map(A=>t.jsx(lL,{t:A,selected:s.ticket===A.id,onOpen:()=>y(A.id)},A.id)),$.length===0&&t.jsx("div",{className:"empty-lane",children:"Nothing here"})]},N.stage)})}),t.jsxs("div",{className:"foot",children:[t.jsxs("span",{children:["Last 30 days ",t.jsxs("b",{children:[k.stats.released30," tickets released"]})]}),t.jsxs("span",{children:[t.jsx("b",{children:k.stats.bugs30})," ",k.stats.bugs30===1?"bug":"bugs"," found after release"]}),t.jsxs("span",{children:[t.jsx("b",{children:k.stats.open})," open tickets"]}),t.jsx(mF,{}),t.jsx("span",{className:"grow"}),(k.archived?.length??0)>0&&t.jsx("button",{className:"btn sm quiet",title:"squad board --archived",onClick:()=>p(!d),children:d?"Hide archived":`Show archived (${k.archived.length})`}),t.jsx("button",{className:"btn sm quiet",onClick:()=>o("bug"),children:"Report a bug"})]}),s.ticket&&t.jsx(Lw,{id:s.ticket,onClose:j}),i==="new"&&t.jsx(Tb,{onClose:()=>o(null),onCreated:N=>y(N.id)}),i==="pull"&&t.jsx(OR,{onClose:()=>o(null),onCreated:N=>y(N.id)}),i==="bug"&&t.jsx(Ym,{onClose:()=>o(null)})]})}function lL({t:e,selected:n,onOpen:s}){const r=!!e.waiting||e.quiet?.kind==="stuck"||qs(e)||bs(e),i=la();return t.jsxs("button",{className:`card ${r?"you":""} ${e.kind==="bug"?"bug":""} ${n?"sel":""}`,onClick:s,children:[t.jsxs("div",{className:"row1",children:[t.jsx("span",{className:"id",children:e.id}),e.track==="express"&&t.jsx("span",{className:"prio express",children:"Express"}),t.jsx(FI,{t:e}),r?t.jsx("span",{className:"youtag",children:"You"}):e.kind==="bug"?t.jsx("span",{className:"prio",children:"Bug"}):e.priority==="high"?t.jsx("span",{className:"prio",children:"High"}):null,i&&!_n(e,i)&&t.jsx(D,{className:"prio owner",title:"Their squad works on it",text:al(e)}),e.archived&&t.jsx("span",{className:"prio owner",children:"Archived"}),e.gates?.checks==="unchecked"&&t.jsx("span",{className:"prio unchecked",title:h1,children:"Not checked"}),t.jsx(vR,{t:e}),t.jsx(Rz,{t:e})]}),t.jsx(D,{as:"h4",text:e.title}),t.jsx(zI,{t:e}),kw(e)&&!r?t.jsx(cz,{t:e}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"st",children:[e.live&&!r?t.jsx("span",{className:"live"}):e.stage==="release"?t.jsx(ge,{size:13,strokeWidth:2.5}):null,t.jsx(D,{text:e.quiet?e.quiet.kind==="stuck"?`Looks stuck: ${e.quiet.command??"no progress"}`:`Taking long: ${e.quiet.command??e.status}`:e.status})]}),typeof e.progress=="number"&&!r&&t.jsx("div",{className:"bar",children:t.jsx("i",{style:{width:`${e.progress}%`}})})]})]})}function cL({onPull:e}){const s=$e({queryKey:["tracker"],queryFn:()=>Se("/api/v1/tracker"),refetchInterval:6e4}).data;return s?s.type==="none"?t.jsxs(Ce,{to:"/settings",className:"btn",children:[t.jsx(ks,{size:15})," Connect a tracker"]}):t.jsxs("button",{className:"btn",onClick:e,children:[t.jsx(ks,{size:15})," Pull from ",s.label??"the tracker"]}):null}function Oo({list:e,label:n="Tickets that could not be read"}){return t.jsx("section",{className:"stuckbox",role:"alert","aria-label":n,style:{marginBottom:14},children:e.map(s=>t.jsxs("div",{children:[t.jsx("p",{children:s.problem}),t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For an engineer"}),t.jsx("pre",{className:"mono note",style:{whiteSpace:"pre-wrap"},children:`${s.file}
661
+ ${s.detail}`})]})]},s.id))})}function uL({settings:e}){return e?t.jsx("div",{className:"center",children:t.jsxs("div",{role:"alert",children:[t.jsx("h2",{children:"This board cannot open"}),t.jsx("p",{children:e})]})}):t.jsx("div",{className:"center",children:t.jsxs("div",{children:[t.jsx("h2",{children:"No board yet"}),t.jsx("p",{children:"This project has not been set up yet. Go to Home to set it up, or to try a sample board."}),t.jsxs("p",{style:{marginTop:12},children:[t.jsx("a",{className:"btn",href:"/",children:"Go to Home"})," ",t.jsx(re,{text:"squad demo"})]})]})})}function dL(){const{id:e}=Su({from:"/tickets/$id/proof"}),n=Qo(e),[s,r]=C.useState(0),[i,o]=C.useState(null),l=n.data;if(!l)return t.jsx("div",{className:"center",children:n.isError?`No ticket ${e}.`:"Loading…"});const u=l.proof??[],d=u[Math.min(s,u.length-1)],p=l.waiting?.kind==="proof",f=l.gates,{pictures:m,starts:x}=Aw(u,j=>ss(`/api/v1/proof/${j}`)),y=x[Math.min(s,u.length-1)]??0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsxs("span",{className:"crumbs",children:[t.jsx(Ce,{to:"/inbox",children:"Waiting for you"})," /",t.jsx(Ce,{to:"/board",search:{ticket:l.id},children:t.jsx(D,{lead:l.id,text:l.title})})," ","/ ",t.jsx("b",{children:"Proof"})]}),t.jsx("span",{className:"grow"}),t.jsx(Fw,{t:l})]}),t.jsxs("div",{className:`gatebar ${f?.checks==="unchecked"?"unchecked":""}`,children:[t.jsx(es,{state:f?.checks,text:Cw(f)}),t.jsx(es,{state:f?.review,text:f?.review==="skipped"?"Review notes open, you continued":`Review approved${f?.reviewBy?` by ${f.reviewBy}`:""}`}),t.jsx(es,{state:f?.proof,text:$w(l)}),t.jsx("span",{style:{marginLeft:6},children:"Nothing ships without these three."})]}),t.jsx(Ew,{g:f,className:"gatebar-why"}),t.jsx(ua,{t:l,className:"gatebar-why"}),t.jsxs("div",{className:"split proofsplit",children:[t.jsxs("div",{className:"critlist",children:[t.jsxs("div",{className:"lbl",style:{marginTop:0},children:["Done when · ",u.length]}),u.map((j,k)=>t.jsxs("button",{className:`crit ${k===s?"on":""}`,...De(j.criterion),onClick:()=>r(k),children:[t.jsx(Pw,{shows:j.shows}),t.jsxs("span",{children:[t.jsx(D,{text:j.criterion}),t.jsx(Rf,{shows:j.shows}),fu(j).length>0&&t.jsx("small",{className:"critpage-s",dir:"ltr",children:fu(j).join(" · ")})]})]},j.criterion)),u.length===0&&t.jsx("p",{className:"note",children:Tw(l)}),t.jsx(If,{t:l}),oa(l)&&t.jsx(g1,{t:l})]}),t.jsx("div",{className:"stage",children:d?t.jsxs(t.Fragment,{children:[t.jsx(D,{as:"h3",text:d.criterion}),d.shows&&t.jsxs("p",{className:`verdictline ${p1(d.shows)}`,children:[t.jsx(Rf,{shows:d.shows}),d.shows!=="met"&&Lo(d)&&t.jsx(D,{text:Lo(d)})]}),Gr(d)&&t.jsxs("p",{className:"critpage",children:["Page ",t.jsx("code",{children:Gr(d)})]}),Mo(d.after)?t.jsx(u1,{file:d.after,...d.note?{note:d.note}:{}}):t.jsxs("div",{className:"ba",children:[t.jsxs("div",{children:[t.jsx("div",{className:"cap",children:t.jsx(D,{text:d.beforeLabel})}),t.jsx("button",{className:"zoom",onClick:()=>o(y),"aria-label":`Open ${d.beforeLabel} full size`,children:t.jsx("img",{src:ss(`/api/v1/proof/${d.before}`),alt:`${d.criterion}, ${d.beforeLabel}`})})]}),t.jsxs("div",{children:[t.jsx("div",{className:"cap",children:t.jsx(D,{text:d.afterLabel})}),t.jsx("button",{className:"zoom",onClick:()=>o(y+1),"aria-label":`Open ${d.afterLabel} full size`,children:t.jsx("img",{src:ss(`/api/v1/proof/${d.after}`),alt:`${d.criterion}, ${d.afterLabel}`})})]})]}),d.note&&!Mo(d.after)&&t.jsx(D,{as:"p",className:"note",text:d.note}),t.jsx(Rw,{shot:d,first:y+2,onOpen:o})]}):t.jsx("p",{className:"note",children:"Nothing to compare."})})]}),i!==null&&t.jsx(oi,{pictures:m,start:i,onClose:()=>o(null)}),p?t.jsx(Mw,{t:l,sticky:!0}):t.jsx("div",{className:"stickybar",children:t.jsx(D,{className:"note",text:l.status})})]})}function hL(){const e=q8(),n=Ke(),[s,r]=C.useState(null),[i,o]=C.useState(null),l=e.data??[],u=l.find(f=>f.version===s)??l.find(f=>f.status==="draft")??l[0],d=n.data?.ready?n.data.meta.engine==="demo":!1,p=n.data?.brokenRecords?.filter(f=>f.kind==="release")??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Releases"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad release"})]}),p.length>0&&t.jsx(Oo,{list:p,label:"Releases that could not be read"}),t.jsxs("div",{className:"split rel",children:[t.jsx("div",{className:"listcol",children:l.map(f=>t.jsxs("button",{className:`litem ${u?.version===f.version?f.status==="draft"?"on":"on plain":""}`,onClick:()=>r(f.version),children:[t.jsxs("b",{children:[f.version,f.status==="draft"?t.jsx("span",{className:"youtag",children:f.items.length?"Ready":"Empty"}):f.bugs?.length?t.jsxs("span",{className:"prio",children:[f.bugs.length," ",f.bugs.length===1?"bug":"bugs"]}):null]}),f.status==="draft"?"Next release":f.unpushed?.length?"Not sent yet":Ws(f.date)," · ",f.items.length," ",f.items.length===1?"ticket":"tickets"]},f.version))}),u?t.jsx(pL,{r:u,onReleased:o,live:!d}):e.isError&&!e.data?t.jsx(So,{what:"the releases",error:e.error,onRetry:()=>void e.refetch()}):t.jsx("div",{className:"center",children:"No releases yet."})]}),i&&t.jsx(_R,{release:i,demo:d,onClose:()=>o(null)})]})}function pL({r:e,onReleased:n,live:s}){const r=pe(),i=Ke(),o=R=>(i.data?.ready?i.data.tickets.find(E=>E.id===R)?.title:void 0)??e.titles?.[R]??R,[l,u]=C.useState(!1),[d,p]=C.useState(e.notes),[f,m]=C.useState(!1),x=i.data?.ready?i.data.meta:void 0,y=x?.repos?.length?[...new Set(e.targets.flatMap(R=>Yk(x.parts,R.repo)))]:[],[j,k]=C.useState(!1),[b,S]=C.useState(!1);C.useEffect(()=>{l||p(e.notes)},[e.notes,l]);const N=e.status==="draft",$=e.unpushed??[],A=e.version.endsWith(".0")?"New features, nothing breaks for users.":"Fixes only, nothing new to learn.";return t.jsxs("div",{className:"detail",children:[t.jsx("h2",{style:{fontSize:24,fontStretch:"88%"},children:N?`Release ${e.version}`:e.version}),t.jsx("p",{className:"note",style:{marginTop:2},children:N?"The squad prepared this release. Read it, edit the notes if you like, then release.":`Released ${Ws(e.date)}`}),$.length>0&&t.jsxs("div",{className:"box",style:{marginTop:10,color:"var(--you-ink)"},children:[t.jsx("b",{children:"Not sent yet."})," The release is made on this computer, but it did not reach your team's shared copy of the code, so its tickets stay open.",$.map(R=>t.jsxs("div",{style:{marginTop:6},children:[R.plain??"An engineer can see why below.",t.jsxs("details",{style:{marginTop:4},children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsxs("div",{className:"mono",style:{fontSize:12.5,marginTop:4},children:[R.repo==="."?"project":R.repo,": ",R.base," → ",R.remote,": ",R.error]})]})]},R.repo)),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:10},children:[t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/push`},{onSuccess:R=>R.unpushed?.length?void 0:n(R)}),children:[t.jsx(io,{size:15})," Send again"]}),t.jsx("button",{className:"btn quiet",disabled:r.isPending,title:"An engineer brought it in by hand, so Send again cannot see it. You say how; its tickets close.",onClick:()=>S(!0),children:"It reached it another way"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad release ${e.version} --push-again`})]})]}),N&&e.log&&e.log.length>0&&t.jsxs("div",{className:"box",style:{marginTop:10},children:[t.jsx("b",{children:"Last time it did not go out."}),e.log.map(R=>t.jsxs("div",{className:"checkrow",style:R.ok?void 0:{color:"var(--you-ink)"},...De(R.text),children:[t.jsx("span",{className:`cbx ${R.ok?"on":""}`,children:R.ok?t.jsx(ge,{size:11,strokeWidth:3}):"!"}),t.jsx(D,{text:R.text})]},R.text))]}),t.jsx("div",{className:"lbl",children:"What's inside"}),e.items.map(R=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:R.id}),t.jsx(D,{as:"b",text:R.title}),t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"flex-end",flexWrap:"wrap"},children:[R.outside&&t.jsxs("span",{className:`prio outside${R.outside.checked?" checked":""}`,children:[R.outside.from?`Continued outside from ${R.outside.from}`:"Worked outside squad-kit",R.outside.checked?", checked":""]}),Gu(R.gates)?t.jsx(es,{state:"pending",text:"Not checked by squad-kit"}):R.gates?.checks==="unchecked"?t.jsx(es,{state:"unchecked",text:"Not checked · review, proof"}):R.gates&&t.jsxs("span",{className:"pill ok",children:[t.jsx(ge,{size:13,strokeWidth:2.5})," Checks, review, proof"]}),N&&e.items.length>1&&t.jsx("button",{className:"btn sm quiet",title:`squad release --without ${R.id}`,disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/take-out`,body:{ticket:R.id},done:`${R.id} goes out with the next release`}),children:"Take out"})]})]},R.id)),e.items.length===0&&t.jsx("p",{className:"note",children:"No tickets yet. Tickets join after you check their proof."}),N&&e.items.length>1&&t.jsx("div",{style:{marginTop:2},children:t.jsx(re,{text:`squad release --without ${e.items[e.items.length-1].id}`})}),(e.out?.length??0)>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:N?"Taken out of this release":"Left out of this release"}),e.out.map(R=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:R}),t.jsx(D,{as:"b",text:o(R)}),N?t.jsxs("button",{className:"btn sm",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/put-back`,body:{ticket:R},done:`${R} is back in ${e.version}`}),children:[t.jsx(xk,{size:13})," Put back"]}):t.jsx("span",{className:"note",children:"Goes out with the next release"})]},R)),N&&t.jsx("p",{className:"note",children:"Its code stays in the project. This release leaves it out, and it goes out with the next one."}),N&&t.jsx("div",{style:{marginTop:6},children:t.jsx(re,{text:`squad release --put-back ${e.out[0]}`})})]}),!N&&e.bugs&&e.bugs.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Bugs found after this release"}),e.bugs.map(R=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:R}),t.jsx(Ce,{to:"/board",search:{ticket:R},children:t.jsx("b",{children:"Open the bug"})}),t.jsx("span",{})]},R))]}),t.jsxs("div",{className:"grid2",children:[t.jsxs("div",{children:[t.jsx("div",{className:"lbl",children:"Version"}),t.jsxs("div",{className:"ver",children:[t.jsx("span",{className:"from",children:e.from.replace(/^v/,"")}),t.jsx(Vi,{size:20}),t.jsx("span",{children:e.version.replace(/^v/,"")})]}),t.jsx("p",{className:"note",style:{marginTop:4},children:A}),t.jsx("div",{className:"lbl",children:N||!e.log?"Also":"What the release did"}),!N&&e.log?e.log.map(R=>t.jsxs("div",{className:"checkrow",style:R.ok?void 0:{color:"var(--you-ink)"},...De(R.text),children:[t.jsx("span",{className:`cbx ${R.ok?"on":""}`,children:R.ok?t.jsx(ge,{size:11,strokeWidth:3}):"!"}),t.jsx(D,{text:R.text})]},R.text)):[["changelog","Update the changelog"],["tag",`Mark the code as ${e.version}`],["pipeline","Run your after-release step"],["whatsapp","Draft a WhatsApp note for my manager"]].map(([R,E])=>t.jsxs("div",{className:"checkrow",children:[t.jsx("span",{className:`cbx ${e.addons[R]?"on":""}`,children:e.addons[R]&&t.jsx(ge,{size:11,strokeWidth:3})}),E]},R))]}),t.jsxs("div",{children:[t.jsxs("div",{className:"lbl",children:["Release notes",N&&", written by the squad",t.jsx("span",{className:"grow",style:{flex:1}}),N&&!l&&t.jsxs("button",{className:"btn sm",onClick:()=>u(!0),children:[t.jsx(wo,{size:13})," Edit"]})]}),l?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{className:"textarea mono",style:{minHeight:180,fontSize:13},dir:xe(d),value:d,onChange:R=>p(R.target.value)}),t.jsxs("div",{style:{display:"flex",gap:8,marginTop:8},children:[t.jsx("button",{className:"btn sm pri",onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/notes`,method:"PUT",body:{notes:d},done:"Notes saved"},{onSuccess:()=>u(!1)}),children:"Save notes"}),t.jsx("button",{className:"btn sm",onClick:()=>u(!1),children:"Cancel"})]})]}):t.jsx(M8,{notes:e.notes})]})]}),t.jsx("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:26},children:N?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:e.items.length===0,onClick:()=>m(!0),children:[t.jsx(io,{size:15})," Release ",e.version]}),t.jsx("span",{className:"note",children:"You'll be asked once to confirm."})]}):t.jsxs("button",{className:"btn",onClick:()=>k(!0),children:["Report a bug in ",e.version]})}),!!e.gateStop?.length&&t.jsx(gL,{r:e,onReleased:n}),f&&t.jsxs(He,{title:`Release ${e.version}?`,onClose:()=>m(!1),icon:t.jsx("span",{className:"glyph",children:t.jsx(io,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/release`},{onSuccess:R=>{m(!1),n(R)}}),children:[t.jsx(io,{size:15})," Yes, release it"]}),t.jsx("button",{className:"btn",onClick:()=>m(!1),children:"Not yet"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad release ${e.version}`})]}),children:[t.jsxs("p",{children:[e.items.length," tickets go live:"," ",e.items.map((R,E)=>t.jsxs("span",{children:[E>0&&", ",t.jsx(D,{text:R.title})]},R.id)),"."]}),e.targets.length>0&&t.jsx("div",{className:"box",style:{marginBottom:6},children:y.length>0?t.jsxs("details",{children:[t.jsx("summary",{children:t.jsxs("b",{children:["This release changes ",y.join(", ")]})}),t.jsx("div",{className:"note",style:{marginTop:6},children:"For engineers:"}),t.jsx(V2,{r:e})]}):t.jsxs("details",{children:[t.jsx("summary",{children:t.jsx("b",{children:e.targets.some(R=>R.remote)?"This release goes to your team's shared copy of the code":"This release stays on this computer: the project has no shared copy"})}),t.jsx("div",{className:"note",style:{marginTop:6},children:"For engineers:"}),t.jsx(V2,{r:e})]})})]}),!N&&s&&t.jsx(fL,{}),j&&t.jsx(Ym,{foundIn:e.version,onClose:()=>k(!1)}),b&&t.jsx(mL,{version:e.version,onClose:()=>S(!1),onDone:n})]})}function V2({r:e}){return t.jsxs(t.Fragment,{children:[e.targets.map(n=>t.jsxs("div",{className:"mono",style:{fontSize:12.5,marginTop:6},children:[n.repo==="."?"project":n.repo,": ",n.branch," ",n.remote?`→ pushed to ${n.remote}`:"(no remote, stays on this computer)"]},n.repo)),t.jsx("p",{className:"note",style:{marginTop:6},children:"Change the branch or remote in Settings first if this is not right."})]})}function fL(){const e=pe(),s=$e({queryKey:["branches"],queryFn:()=>Se("/api/v1/branches"),refetchInterval:3e4}).data;return!s||!s.here.length&&!s.remote.length?null:t.jsxs("div",{className:"box",style:{marginTop:18},children:[t.jsxs("b",{children:[t.jsx(Jp,{size:14})," Left over from released tickets"]}),t.jsxs("p",{className:"note",style:{margin:"4px 0 8px"},children:[[s.here.length?`${s.here.length} on this computer`:"",s.remote.length?`${s.remote.length} in your team's shared copy of the code`:""].filter(Boolean).join(" and "),". Their work is in the code already, so nothing is lost."]}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[s.here.length>0&&t.jsx("button",{className:"btn sm",disabled:e.isPending,onClick:()=>e.mutate({path:"/api/v1/branches/clean",body:{remote:!1},done:"Deleted what was left over on this computer"}),children:"Delete them here"}),s.remote.length>0&&t.jsxs("button",{className:"btn sm",disabled:e.isPending,onClick:()=>e.mutate({path:"/api/v1/branches/clean",body:{remote:!0},done:"Deleted what was left over here and in the shared copy of the code"}),children:["Delete them ",s.here.length?"here and ":"","in the shared copy"]}),t.jsx("span",{className:"grow",style:{flex:1}}),t.jsx(re,{text:s.remote.length?"squad branches --clean --remote":"squad branches --clean"})]})]})}function mL({version:e,onClose:n,onDone:s}){const r=Hn(),{toast:i}=Le(),[o,l]=C.useState(""),[u,d]=C.useState(null),[p,f]=C.useState(!1),m=async x=>{f(!0);try{const y=await at(`/api/v1/releases/${e}/mark-sent`,"POST",{reason:o,...x?{anyway:x}:{}});r.invalidateQueries(),s(y),n()}catch(y){y instanceof $u&&y.status===409?d(y.message):i(y instanceof Error?y.message:String(y),"err")}finally{f(!1)}};return t.jsxs(He,{title:"It reached it another way",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),u?t.jsx("button",{className:"btn pri",disabled:p||!o.trim(),onClick:()=>void m(!0),children:"Mark it anyway"}):t.jsx("button",{className:"btn pri",disabled:p||!o.trim(),onClick:()=>void m(!1),children:p?"Looking for it…":"Mark it as sent"})]}),children:[t.jsxs("p",{className:"note",children:[e,"'s tickets close, and nothing checks after this. squad-kit looks in your team's shared copy of the code first."]}),t.jsx("div",{className:"lbl",children:"How did it get there?"}),t.jsx("textarea",{className:"waynote",rows:2,dir:xe(o),value:o,onChange:x=>l(x.target.value),placeholder:"For example: Sara merged it by hand"}),u&&t.jsx("div",{className:"box",style:{marginTop:10},children:u}),t.jsx("div",{style:{marginTop:10},children:t.jsx(re,{text:`squad release ${e} --mark-sent --reason ${Me(o.trim()||"how it got there")}${u?" --anyway":""}`})})]})}function gL({r:e,onReleased:n}){const s=pe(),[r,i]=C.useState(""),o=u=>s.mutate({path:`/api/v1/releases/${e.version}/release`,...u?{body:{goOn:u}}:{}},{onSuccess:n}),l=e.gateStop.filter(u=>u.output);return t.jsxs("div",{className:"box",role:"alert",style:{marginTop:12},children:[t.jsxs("b",{children:[e.version," did not go out. Nothing changed."]}),e.gateStop.map(u=>t.jsxs("p",{dir:"auto",children:["Your team's check ",t.jsx("b",{children:u.name})," ",u.result==="failed"?"did not pass.":`could not run. ${u.why??""}`]},u.id)),l.length>0&&t.jsxs("details",{children:[t.jsx("summary",{children:"Let an engineer look"}),t.jsx("pre",{className:"mono",dir:"ltr",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",fontSize:12},children:l.map(u=>`${u.name}:
662
+ ${u.output}`).join(`
663
+
664
+ `)})]}),t.jsxs("div",{className:"field",style:{marginTop:10},children:[t.jsx("label",{htmlFor:"gate-why",children:"To go on without this check, write why. It stays on the stories and the release notes."}),t.jsx("textarea",{id:"gate-why",className:"textarea",dir:xe(r),value:r,onChange:u=>i(u.target.value)})]}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[t.jsx("button",{className:"btn pri sm",disabled:s.isPending,onClick:()=>o(),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:s.isPending||!r.trim(),onClick:()=>o(r.trim()),children:"Go on without this check"})]})]})}function xL(){const[e,n]=C.useState(void 0),s=$e({queryKey:["backlog",e??""],queryFn:()=>Se(`/api/v1/backlog${e?`?sprint=${encodeURIComponent(e)}`:""}`),refetchInterval:15e3}),r=s.data,i=e??r?.sprint,o=r?.sprints.find(l=>l.path===i)?.name;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Backlog"}),r?.connected&&r.sprints.length>0&&t.jsxs("select",{className:"input",style:{width:"auto",marginLeft:12},value:i??"all",onChange:l=>n(l.target.value),"aria-label":"Sprint",children:[r.sprints.map(l=>t.jsxs("option",{value:l.path,children:[as(l.name),l.current?" (now)":""]},l.path)),t.jsx("option",{value:"all",children:"Everything open"})]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:o?`squad backlog --sprint ${Me(o)}`:"squad backlog"})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page",children:s.isLoading?t.jsx("p",{className:"note",children:"Reading the backlog from Azure…"}):r?.connected?r.error?t.jsx("p",{className:"note",style:{color:"var(--bug)"},children:r.error}):r.items.length===0?t.jsxs("p",{className:"note",children:["Nothing open in ",o??"this sprint","."]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"note",style:{marginBottom:12},children:[r.items.length," open ",r.items.length===1?"item":"items"," in ",o??"the backlog",", in backlog order. Start one and the squad picks it up; Azure follows along."]}),t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:80},children:"ID"}),t.jsx("th",{children:"Title"}),t.jsx("th",{style:{width:70},children:"Points"}),t.jsx("th",{style:{width:100},children:"On Azure"}),t.jsx("th",{style:{width:260},children:"squad-kit"})]})}),t.jsx("tbody",{children:r.items.map(l=>t.jsx(yL,{w:l},l.id))})]})]}):t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(d8,{size:18})}),t.jsxs("div",{children:[t.jsx("b",{children:"Connect Azure DevOps"}),t.jsxs("span",{children:[r?.error??"Add your Azure organization, project and token, and your stories and bugs show up here."," ",t.jsx(Ce,{to:"/settings",style:{fontWeight:600},children:"Open Settings"})]})]})]})})})]})}function yL({w:e}){const n=pe();return t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:t.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.id," ",t.jsx(xs,{size:11})]})}),t.jsx("td",{...De(e.title),children:t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.type==="Bug"&&t.jsxs("span",{className:"pill bug",style:{padding:"2px 8px"},children:[t.jsx(Os,{size:12})," Bug"]}),t.jsx(D,{style:{fontWeight:600},text:e.title})]})}),t.jsx("td",{children:e.points??""}),t.jsx("td",{children:e.state}),t.jsx("td",{children:e.ticket?t.jsxs(Ce,{to:"/board",search:{ticket:e.ticket.id},style:{color:"var(--muted)"},children:[t.jsx("b",{className:"mono",style:{color:"var(--text)"},children:e.ticket.id})," ",e.ticket.stage==="done"?"Released":_s[e.ticket.stage]]}):t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/backlog/${e.id}/start`,done:`${e.ref} is on the board. The Analyst is reading it.`}),children:[t.jsx(Sn,{size:13})," Start"]})})]})}const Qu=["Structure","Data","Security","Interface","Rules"],jL={nextdotjs:{hex:"000000",path:"M18.665 21.978C16.758 23.255 14.465 24 12 24 5.377 24 0 18.623 0 12S5.377 0 12 0s12 5.377 12 12c0 3.583-1.574 6.801-4.067 9.001L9.219 7.2H7.2v9.596h1.615V9.251l9.85 12.727Zm-3.332-8.533 1.6 2.061V7.2h-1.6v6.245Z"},react:{hex:"61DAFB",path:"M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"},typescript:{hex:"3178C6",path:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"},javascript:{hex:"F7DF1E",path:"M0 0h24v24H0V0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873-.736-.345-1.554-.585-1.797-1.14-.091-.33-.105-.51-.046-.705.15-.646.915-.84 1.515-.66.39.12.75.42.976.9 1.034-.676 1.034-.676 1.755-1.125-.27-.42-.404-.601-.586-.78-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005-1.14 1.291-.811 3.541.569 4.471 1.365 1.02 3.361 1.244 3.616 2.205.24 1.17-.87 1.545-1.966 1.41-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109 1.74 1.756 6.09 1.666 6.871-1.004.029-.09.24-.705.074-1.65l.046.067zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805 0 1.232.063 2.363-.138 2.711-.33.689-1.18.601-1.566.48-.396-.196-.597-.466-.83-.855-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517.855.51 2.004.675 3.207.405.783-.226 1.458-.691 1.811-1.411.51-.93.402-2.07.397-3.346.012-2.054 0-4.109 0-6.179l.004-.056z"},prisma:{hex:"2D3748",path:"M21.8068 18.2848L13.5528.7565c-.207-.4382-.639-.7273-1.1286-.7541-.5023-.0293-.9523.213-1.2062.6253L2.266 15.1271c-.2773.4518-.2718 1.0091.0158 1.4555l4.3759 6.7786c.2608.4046.7127.6388 1.1823.6388.1332 0 .267-.0188.3987-.0577l12.7019-3.7568c.3891-.1151.7072-.3904.8737-.7553s.1633-.7828-.0075-1.1454zm-1.8481.7519L9.1814 22.2242c-.3292.0975-.6448-.1873-.5756-.5194l3.8501-18.4386c.072-.3448.5486-.3996.699-.0803l7.1288 15.138c.1344.2856-.019.6224-.325.7128z"},sqlite:{hex:"003B57",path:"M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71 8.71 0 0 0-.547.535c-2.109 2.237-4.066 6.38-4.674 9.544.237.48.422 1.093.544 1.561a13.044 13.044 0 0 1 .164.703s-.019-.071-.096-.296l-.05-.146a1.689 1.689 0 0 0-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376 1.176.484.884.778 2.4.778 2.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304 1.346-.226 1.478.152.256.296.698.422 1.186.286 1.1.485 2.44.485 2.44l.017.224a22.41 22.41 0 0 0 .056 2.748c.095 1.146.273 2.13.5 2.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29 1.661-8.304 1.723-4.55 4.113-8.201 6.3-9.945-1.993 1.8-4.692 7.63-5.5 9.788-.904 2.416-1.545 4.684-1.931 6.857.666-2.037 2.821-2.912 2.821-2.912s1.057-1.304 2.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184 3.613-1.72C21.695 7.9 24.195 2.767 21.678.521m-18.573.543A1.842 1.842 0 0 0 1.27 2.9v16.608a1.84 1.84 0 0 0 1.835 1.834h9.418a22.953 22.953 0 0 1-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01 27.01 0 0 0-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432 0-.12.015-.245.037-.386a9.98 9.98 0 0 1 .234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8 32.8 0 0 1 .382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28 2.587-7.443 4.8-9.791.066-.069.133-.128.198-.194Z"},vitest:{hex:"6E9F18",path:"M13.74024 1.05293a.49504.49504 0 0 0-.1569.02512.49338.49338 0 0 0-.25056.1876L7.59513 9.56159a.4895.4895 0 0 0-.08373.22327.48846.48846 0 0 0 .03163.23629.4893.4893 0 0 0 .13985.19319.4927.4927 0 0 0 .2149.10481l3.70685.78609-.22947 4.58007a.48834.48834 0 0 0 .08466.30017.49205.49205 0 0 0 .24931.18854c.10157.03398.21174.03444.3135.00064a.49387.49387 0 0 0 .25056-.18761l5.73735-8.29594a.4884.4884 0 0 0 .08404-.22327c.009-.08015-.0016-.16137-.03163-.23629a.48835.48835 0 0 0-.13985-.19319.49318.49318 0 0 0-.2149-.1048l-3.70686-.7861.22947-4.58008a.48802.48802 0 0 0-.08466-.30017.4913.4913 0 0 0-.24931-.18853.49439.49439 0 0 0-.1566-.02574zM1.15697 9.78795c-.30647.0012-.60009.12378-.81679.34048a1.16107 1.16107 0 0 0-.34017.81648 1.162 1.162 0 0 0 .33366.81957l10.84241 10.8421a1.15762 1.15762 0 0 0 .37677.25211 1.1583 1.1583 0 0 0 .44467.08838c.00084 0 .0016-.00031.0025-.00031.00073 0 .0014.00031.0022.00031a1.15827 1.15827 0 0 0 .44467-.08838 1.15731 1.15731 0 0 0 .37677-.2521l10.84236-10.8421a1.16272 1.16272 0 0 0 .33397-.81958c-.0013-.30647-.12376-.59976-.34048-.81648a1.1616 1.1616 0 0 0-.81679-.34048 1.16114 1.16114 0 0 0-.81926.33366l-5.4012 5.4009c-.0078.0074-.01718.01255-.02482.02015L12 20.14011l-4.59776-4.59745c-.0074-.0074-.01659-.01238-.02419-.01954l-5.4015-5.40151a1.162 1.162 0 0 0-.81958-.33366Z"},eslint:{hex:"4B32C3",path:"M7.257 9.132L11.816 6.5a.369.369 0 0 1 .368 0l4.559 2.632a.369.369 0 0 1 .184.32v5.263a.37.37 0 0 1-.184.319l-4.559 2.632a.369.369 0 0 1-.368 0l-4.559-2.632a.369.369 0 0 1-.184-.32V9.452a.37.37 0 0 1 .184-.32M23.852 11.53l-5.446-9.475c-.198-.343-.564-.596-.96-.596H6.555c-.396 0-.762.253-.96.596L.149 11.509a1.127 1.127 0 0 0 0 1.117l5.447 9.398c.197.342.563.517.959.517h10.893c.395 0 .76-.17.959-.512l5.446-9.413a1.069 1.069 0 0 0 0-1.086m-4.51 4.556a.4.4 0 0 1-.204.338L12.2 20.426a.395.395 0 0 1-.392 0l-6.943-4.002a.4.4 0 0 1-.205-.338V8.08c0-.14.083-.269.204-.338L11.8 3.74c.12-.07.272-.07.392 0l6.943 4.003a.4.4 0 0 1 .206.338z"},primereact:{hex:"03C4E8",path:"M12.01 0c-1.212 0-2.297.62-2.903 1.66l-1.52 2.608H4.303A3.287 3.287 0 0 0 1.43 5.911a3.226 3.226 0 0 0 0 3.285l1.642 2.819-1.646 2.825a3.202 3.202 0 0 0 0 3.261 3.265 3.265 0 0 0 2.851 1.631h2.925l.865.856L9.09 22.34A3.322 3.322 0 0 0 11.991 24c1.211 0 2.296-.62 2.902-1.66l.816-1.4 1.22-1.208h2.77a3.287 3.287 0 0 0 2.87-1.643c.6-1.028.6-2.256 0-3.285l-1.642-2.82 1.646-2.824a3.202 3.202 0 0 0 0-3.261 3.265 3.265 0 0 0-2.851-1.631H16.43L14.91 1.66A3.322 3.322 0 0 0 12.01 0Zm0 .719c.948 0 1.798.486 2.273 1.3l1.31 2.249H8.425l1.31-2.248A2.603 2.603 0 0 1 12.01.719Zm.33 4.265v7.74h.962l5.904-2.174.014-.057.87 1.492-1.33 2.282.171-3.173-1.51.543-1.51 1.494-1.237-.27.962 1.357v4.212l1.452-1.296-.708 1.216v.001l-.744.622v.654l-.412.708V14.49l-1.098-1.63-.687.407h-2.746l-.687-.407-1.098 1.63v6.101l-.412-.706v-.912l-1.036-.867-.729-1.25 1.765 1.574v-4.212l.961-1.358-1.236.271-1.51-1.494-1.511-.543.188 3.455-1.477-2.534.942-1.617.122-.208.088.36 5.904 2.174h.824V4.985Zm1.512 0h.412l.96 2.17 1.935-.2.237.406-2.452.192zm-3.985.001h.412L9.187 7.552l-2.556-.205.072-.124.001.001.163-.28 2.04.21Zm-5.565.001h2.867L5.831 7.282l-1.592-.127.49 2.018-1.237 2.124-1.433-2.46a2.52 2.52 0 0 1 0-2.567 2.568 2.568 0 0 1 2.243-1.284Zm12.547 0h2.873c.928 0 1.759.476 2.223 1.272a2.497 2.497 0 0 1 0 2.543l-1.437 2.466-1.042-1.789.563-2.323-1.833.143Zm3.659 7.718 1.433 2.46a2.52 2.52 0 0 1 0 2.566 2.567 2.567 0 0 1-2.243 1.283h-2.277V18zm-17.016.03 3.22 5.525v.754H4.277a2.545 2.545 0 0 1-2.223-1.27 2.497 2.497 0 0 1 0-2.544z"},tailwindcss:{hex:"06B6D4",path:"M12.001,4.8c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 C13.666,10.618,15.027,12,18.001,12c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C16.337,6.182,14.976,4.8,12.001,4.8z M6.001,12c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 c1.177,1.194,2.538,2.576,5.512,2.576c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C10.337,13.382,8.976,12,6.001,12z"},nodedotjs:{hex:"5FA04E",path:"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"},postgresql:{hex:"4169E1",path:"M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z"},vite:{hex:"646CFF",path:"m8.286 10.578.512-8.657a.306.306 0 0 1 .247-.282L17.377.006a.306.306 0 0 1 .353.385l-1.558 5.403a.306.306 0 0 0 .352.385l2.388-.46a.306.306 0 0 1 .332.438l-6.79 13.55-.123.19a.294.294 0 0 1-.252.14c-.177 0-.35-.152-.305-.369l1.095-5.301a.306.306 0 0 0-.388-.355l-1.433.435a.306.306 0 0 1-.389-.354l.69-3.375a.306.306 0 0 0-.37-.36l-2.32.536a.306.306 0 0 1-.374-.316zm14.976-7.926L17.284 3.74l-.544 1.887 2.077-.4a.8.8 0 0 1 .84.369.8.8 0 0 1 .034.783L12.9 19.93l-.013.025-.015.023-.122.19a.801.801 0 0 1-.672.37.826.826 0 0 1-.634-.302.8.8 0 0 1-.16-.67l1.029-4.981-1.12.34a.81.81 0 0 1-.86-.262.802.802 0 0 1-.165-.67l.63-3.08-2.027.468a.808.808 0 0 1-.768-.233.81.81 0 0 1-.217-.6l.389-6.57-7.44-1.33a.612.612 0 0 0-.64.906L11.58 23.691a.612.612 0 0 0 1.066-.004l11.26-20.135a.612.612 0 0 0-.644-.9z"},angular:{hex:"0F0F11",path:"M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z"},vuedotjs:{hex:"4FC08D",path:"M24,1.61H14.06L12,5.16,9.94,1.61H0L12,22.39ZM12,14.08,5.16,2.23H9.59L12,6.41l2.41-4.18h4.43Z"},dotnet:{hex:"512BD4",path:"M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"},python:{hex:"3776AB",path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"},jest:{hex:"C21325",path:"M22.251 11.82a3.117 3.117 0 0 0-2.328-3.01L22.911 0H8.104L11.1 8.838a3.116 3.116 0 0 0-2.244 2.988c0 1.043.52 1.967 1.313 2.536a8.279 8.279 0 0 1-1.084 1.244 8.14 8.14 0 0 1-2.55 1.647c-.834-.563-1.195-1.556-.869-2.446a3.11 3.11 0 0 0-.91-6.08 3.117 3.117 0 0 0-3.113 3.113c0 .848.347 1.626.903 2.182-.048.097-.097.195-.146.299-.465.959-.993 2.043-1.195 3.259-.403 2.432.257 4.384 1.849 5.489A5.093 5.093 0 0 0 5.999 24c1.827 0 3.682-.917 5.475-1.807 1.279-.632 2.599-1.292 3.898-1.612.48-.118.98-.187 1.508-.264 1.07-.153 2.175-.312 3.168-.89a4.482 4.482 0 0 0 2.182-3.091c.174-.994 0-1.994-.444-2.87.298-.48.465-1.042.465-1.647zm-1.355 0c0 .965-.785 1.75-1.75 1.75a1.753 1.753 0 0 1-1.085-3.126l.007-.007c.056-.042.118-.084.18-.125 0 0 .008 0 .008-.007.028-.014.055-.035.083-.05.007 0 .014-.006.021-.006.028-.014.063-.028.097-.042.035-.014.07-.027.098-.041.007 0 .013-.007.02-.007.028-.007.056-.021.084-.028.007 0 .02-.007.028-.007.034-.007.062-.014.097-.02h.007l.104-.022c.007 0 .02 0 .028-.007.028 0 .055-.007.083-.007h.035c.035 0 .07-.007.111-.007h.09c.028 0 .05 0 .077.007h.014c.055.007.111.014.167.028a1.766 1.766 0 0 1 1.396 1.723zM10.043 1.39h10.93l-2.509 7.4c-.104.02-.208.055-.312.09l-2.64-5.385-2.648 5.35c-.104-.034-.216-.055-.327-.076l-2.494-7.38zm4.968 9.825a3.083 3.083 0 0 0-.938-1.668l1.438-2.904 1.452 2.967c-.43.43-.743.98-.868 1.605H15.01zm-3.481-1.098c.034-.007.062-.014.097-.02h.02c.029-.008.056-.008.084-.015h.028c.028 0 .049-.007.076-.007h.271c.028 0 .049.007.07.007.014 0 .02 0 .035.007.027.007.048.007.076.014.007 0 .014 0 .028.007l.097.02h.007c.028.008.056.015.083.029.007 0 .014.007.028.007.021.007.049.014.07.027.007 0 .014.007.02.007.028.014.056.021.084.035h.007a.374.374 0 0 1 .09.049h.007c.028.014.056.034.084.048.007 0 .007.007.013.007.028.014.05.035.077.049l.007.007c.083.062.16.132.236.201l.007.007a1.747 1.747 0 0 1 .48 1.209 1.752 1.752 0 0 1-3.502 0 1.742 1.742 0 0 1 1.32-1.695zm-6.838-.049c.966 0 1.751.786 1.751 1.751s-.785 1.751-1.75 1.751-1.752-.785-1.752-1.75.786-1.752 1.751-1.752zm16.163 6.025a3.07 3.07 0 0 1-1.508 2.133c-.758.438-1.689.577-2.669.716a17.29 17.29 0 0 0-1.64.291c-1.445.355-2.834 1.05-4.182 1.717-1.724.854-3.35 1.66-4.857 1.66a3.645 3.645 0 0 1-2.154-.688c-1.529-1.056-1.453-3.036-1.272-4.12.167-1.015.632-1.966 1.077-2.877.028-.055.049-.104.077-.16.152.056.312.098.479.126-.264 1.473.486 2.994 1.946 3.745l.264.139.284-.104c1.216-.431 2.342-1.133 3.336-2.071a9.334 9.334 0 0 0 1.445-1.716c.16.027.32.034.48.034a3.117 3.117 0 0 0 3.008-2.327h1.167a3.109 3.109 0 0 0 3.01 2.327c.576 0 1.11-.16 1.57-.43.18.52.236 1.063.139 1.605z"},prettier:{hex:"F7B93E",path:"M8.571 23.429A.571.571 0 0 1 8 24H2.286a.571.571 0 0 1 0-1.143H8c.316 0 .571.256.571.572zM8 20.57H6.857a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143zm-5.714 1.143H4.57a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zM8 18.286H2.286a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143zM16 16H5.714a.571.571 0 0 0 0 1.143H16A.571.571 0 0 0 16 16zM2.286 17.143h1.143a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm17.143-3.429H16a.571.571 0 0 0 0 1.143h3.429a.571.571 0 0 0 0-1.143zM9.143 14.857h4.571a.571.571 0 0 0 0-1.143H9.143a.571.571 0 0 0 0 1.143zm-6.857 0h4.571a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zM20.57 11.43H11.43a.571.571 0 0 0 0 1.142h9.142a.571.571 0 0 0 0-1.142zM9.714 12a.571.571 0 0 0-.571-.571H5.714a.571.571 0 0 0 0 1.142h3.429A.571.571 0 0 0 9.714 12zm-7.428.571h1.143a.571.571 0 0 0 0-1.142H2.286a.571.571 0 0 0 0 1.142zm19.428-3.428H16a.571.571 0 0 0 0 1.143h5.714a.571.571 0 0 0 0-1.143zM2.286 10.286H8a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm13.143-2.857c0 .315.255.571.571.571h5.714a.571.571 0 0 0 0-1.143H16a.571.571 0 0 0-.571.572zm-8.572-.572a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143H6.857zM2.286 8H4.57a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm16.571-2.857c0 .315.256.571.572.571h1.142a.571.571 0 0 0 0-1.143H19.43a.571.571 0 0 0-.572.572zm-1.143 0a.571.571 0 0 0-.571-.572H12.57a.571.571 0 0 0 0 1.143h4.572a.571.571 0 0 0 .571-.571zm-15.428.571h8a.571.571 0 0 0 0-1.143h-8a.571.571 0 0 0 0 1.143zm5.143-2.857c0 .316.255.572.571.572h11.429a.571.571 0 0 0 0-1.143H8a.571.571 0 0 0-.571.571zm-5.143.572h3.428a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm0-2.286H16A.571.571 0 0 0 16 0H2.286a.571.571 0 0 0 0 1.143z"},express:{hex:"000000",path:"M24 18.588a1.529 1.529 0 01-1.895-.72l-3.45-4.771-.5-.667-4.003 5.444a1.466 1.466 0 01-1.802.708l5.158-6.92-4.798-6.251a1.595 1.595 0 011.9.666l3.576 4.83 3.596-4.81a1.435 1.435 0 011.788-.668L21.708 7.9l-2.522 3.283a.666.666 0 000 .994l4.804 6.412zM.002 11.576l.42-2.075c1.154-4.103 5.858-5.81 9.094-3.27 1.895 1.489 2.368 3.597 2.275 5.973H1.116C.943 16.447 4.005 19.009 7.92 17.7a4.078 4.078 0 002.582-2.876c.207-.666.548-.78 1.174-.588a5.417 5.417 0 01-2.589 3.957 6.272 6.272 0 01-7.306-.933 6.575 6.575 0 01-1.64-3.858c0-.235-.08-.455-.134-.666A88.33 88.33 0 010 11.577zm1.127-.286h9.654c-.06-3.076-2.001-5.258-4.59-5.278-2.882-.04-4.944 2.094-5.071 5.264z"},mongodb:{hex:"47A248",path:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z"},mysql:{hex:"4479A1",path:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z"},redis:{hex:"FF4438",path:"M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z"},docker:{hex:"2496ED",path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"},zod:{hex:"408AFF",path:"M2.584 3.582a2.247 2.247 0 0 1 2.112-1.479h14.617c.948 0 1.794.595 2.115 1.487l2.44 6.777a2.248 2.248 0 0 1-.624 2.443l-9.61 8.52a2.247 2.247 0 0 1-2.963.018L.776 12.773a2.248 2.248 0 0 1-.64-2.467Zm12.038 4.887-9.11 5.537 5.74 5.007c.456.399 1.139.396 1.593-.006l5.643-5.001H14.4l6.239-3.957c.488-.328.69-.947.491-1.5l-1.24-3.446a1.535 1.535 0 0 0-1.456-1.015H5.545a1.535 1.535 0 0 0-1.431 1.01l-1.228 3.37z"},hono:{hex:"E36002",path:"M12.445.002a45.529 45.529 0 0 0-5.252 8.146 8.595 8.595 0 0 1-.555-.53 27.796 27.796 0 0 0-1.205-1.542 8.762 8.762 0 0 0-1.251 2.12 20.743 20.743 0 0 0-1.448 5.88 8.867 8.867 0 0 0 .338 3.468c1.312 3.48 3.794 5.593 7.445 6.337 3.055.438 5.755-.333 8.097-2.312 2.677-2.59 3.359-5.634 2.047-9.132a33.287 33.287 0 0 0-2.988-5.59A91.34 91.34 0 0 0 12.615.053a.216.216 0 0 0-.17-.051Zm-.336 3.906a50.93 50.93 0 0 1 4.794 6.552c.448.767.817 1.57 1.108 2.41.606 2.386-.044 4.354-1.951 5.904-1.845 1.298-3.87 1.683-6.072 1.156-2.376-.737-3.75-2.335-4.121-4.794a5.107 5.107 0 0 1 .242-2.266c.358-.908.79-1.774 1.3-2.601l1.446-2.121a397.33 397.33 0 0 0 3.254-4.24Z"},svelte:{hex:"FF3E00",path:"M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z"},nestjs:{hex:"E0234E",path:"M14.131.047c-.173 0-.334.037-.483.087.316.21.49.49.576.806.007.043.019.074.025.117a.681.681 0 0 1 .013.112c.024.545-.143.614-.26.936-.18.415-.13.861.086 1.22a.74.74 0 0 0 .074.137c-.235-1.568 1.073-1.803 1.314-2.293.019-.428-.334-.713-.613-.911a1.37 1.37 0 0 0-.732-.21zM16.102.4c-.024.143-.006.106-.012.18-.006.05-.006.112-.012.161-.013.05-.025.1-.044.149-.012.05-.03.1-.05.149l-.067.142c-.02.025-.031.05-.05.075l-.037.055a2.152 2.152 0 0 1-.093.124c-.037.038-.068.081-.112.112v.006c-.037.031-.074.068-.118.1-.13.099-.278.173-.415.266-.043.03-.087.056-.124.093a.906.906 0 0 0-.118.099c-.043.037-.074.074-.111.118-.031.037-.068.08-.093.124a1.582 1.582 0 0 0-.087.13c-.025.05-.043.093-.068.142-.019.05-.037.093-.05.143a2.007 2.007 0 0 0-.043.155c-.006.025-.006.056-.012.08-.007.025-.007.05-.013.075 0 .05-.006.105-.006.155 0 .037 0 .074.006.111 0 .05.006.1.019.155.006.05.018.1.03.15.02.049.032.098.05.148.013.03.031.062.044.087l-1.426-.552c-.241-.068-.477-.13-.719-.186l-.39-.093c-.372-.074-.75-.13-1.128-.167-.013 0-.019-.006-.031-.006A11.082 11.082 0 0 0 8.9 2.855c-.378.025-.756.074-1.134.136a12.45 12.45 0 0 0-.837.174l-.279.074c-.092.037-.18.08-.266.118l-.205.093c-.012.006-.024.006-.03.012-.063.031-.118.056-.174.087a2.738 2.738 0 0 0-.236.118c-.043.018-.086.043-.124.062a.559.559 0 0 1-.055.03c-.056.032-.112.063-.162.094a1.56 1.56 0 0 0-.148.093c-.044.03-.087.055-.124.086-.006.007-.013.007-.019.013-.037.025-.08.056-.118.087l-.012.012-.093.074c-.012.007-.025.019-.037.025-.031.025-.062.056-.093.08-.006.013-.019.02-.025.025-.037.038-.074.069-.111.106-.007 0-.007.006-.013.012a1.742 1.742 0 0 0-.111.106c-.007.006-.007.012-.013.012a1.454 1.454 0 0 0-.093.1c-.012.012-.03.024-.043.036a1.374 1.374 0 0 1-.106.112c-.006.012-.018.019-.024.03-.05.05-.093.1-.143.15l-.018.018c-.1.106-.205.211-.317.304-.111.1-.229.192-.347.273a3.777 3.777 0 0 1-.762.421c-.13.056-.267.106-.403.149-.26.056-.527.161-.756.18-.05 0-.105.012-.155.018l-.155.037-.149.056c-.05.019-.099.044-.148.068-.044.031-.093.056-.137.087a1.011 1.011 0 0 0-.124.106c-.043.03-.087.074-.124.111-.037.043-.074.08-.105.124-.031.05-.068.093-.093.143a1.092 1.092 0 0 0-.087.142c-.025.056-.05.106-.068.161-.019.05-.037.106-.056.161-.012.05-.025.1-.03.15 0 .005-.007.012-.007.018-.012.056-.012.13-.019.167C.006 7.95 0 7.986 0 8.03a.657.657 0 0 0 .074.31v.006c.019.037.044.075.069.112.024.037.05.074.08.111.031.031.068.069.106.1a.906.906 0 0 0 .117.099c.149.13.186.173.378.272.031.019.062.031.1.05.006 0 .012.006.018.006 0 .013 0 .019.006.031a1.272 1.272 0 0 0 .08.298c.02.037.032.074.05.111.007.013.013.025.02.031.024.05.049.093.073.137l.093.13c.031.037.069.08.106.118.037.037.074.068.118.105 0 0 .006.006.012.006.037.031.074.062.112.087a.986.986 0 0 0 .136.08c.043.025.093.05.142.069a.73.73 0 0 0 .124.043c.007.006.013.006.025.012.025.007.056.013.08.019-.018.335-.024.65.026.762.055.124.328-.254.6-.688-.036.428-.061.93 0 1.079.069.155.44-.329.763-.862 4.395-1.016 8.405 2.02 8.826 6.31-.08-.67-.905-1.041-1.283-.948-.186.458-.502 1.047-1.01 1.413.043-.41.025-.83-.062-1.24a4.009 4.009 0 0 1-.769 1.562c-.588.043-1.177-.242-1.487-.67-.025-.018-.031-.055-.05-.08-.018-.043-.037-.087-.05-.13a.515.515 0 0 1-.037-.13c-.006-.044-.006-.087-.006-.137v-.093a.992.992 0 0 1 .031-.13c.013-.043.025-.086.044-.13.024-.043.043-.087.074-.13.105-.298.105-.54-.087-.682a.706.706 0 0 0-.118-.062c-.024-.006-.055-.018-.08-.025l-.05-.018a.847.847 0 0 0-.13-.031.472.472 0 0 0-.13-.019 1.01 1.01 0 0 0-.136-.012c-.031 0-.062.006-.093.006a.484.484 0 0 0-.137.019c-.043.006-.086.012-.13.024a1.068 1.068 0 0 0-.13.044c-.043.018-.08.037-.124.056-.037.018-.074.043-.118.062-1.444.942-.582 3.148.403 3.787-.372.068-.75.148-.855.229l-.013.012c.267.161.546.298.837.416.397.13.818.247 1.004.297v.006a5.996 5.996 0 0 0 1.562.112c2.746-.192 4.996-2.281 5.405-5.033l.037.161c.019.112.043.23.056.347v.006c.012.056.018.112.025.162v.024c.006.056.012.112.012.162.006.068.012.136.012.204v.1c0 .03.007.067.007.098 0 .038-.007.075-.007.112v.087c0 .043-.006.08-.006.124 0 .025 0 .05-.006.08 0 .044-.006.087-.006.137-.006.018-.006.037-.006.055l-.02.143c0 .019 0 .037-.005.056-.007.062-.019.118-.025.18v.012l-.037.174v.018l-.037.167c0 .007-.007.02-.007.025a1.663 1.663 0 0 1-.043.168v.018c-.019.062-.037.118-.05.174-.006.006-.006.012-.006.012l-.056.186c-.024.062-.043.118-.068.18-.025.062-.043.124-.068.18-.025.062-.05.117-.074.18h-.007c-.024.055-.05.117-.08.173a.302.302 0 0 1-.019.043c-.006.006-.006.013-.012.019a5.867 5.867 0 0 1-1.742 2.082c-.05.031-.099.069-.149.106-.012.012-.03.018-.043.03a2.603 2.603 0 0 1-.136.094l.018.037h.007l.26-.037h.006c.161-.025.322-.056.483-.087.044-.006.093-.019.137-.031l.087-.019c.043-.006.086-.018.13-.024.037-.013.074-.02.111-.031.62-.15 1.221-.354 1.798-.595a9.926 9.926 0 0 1-3.85 3.142c.714-.05 1.426-.167 2.114-.366a9.903 9.903 0 0 0 5.857-4.68 9.893 9.893 0 0 1-1.667 3.986 9.758 9.758 0 0 0 1.655-1.376 9.824 9.824 0 0 0 2.61-5.268c.21.98.272 1.99.18 2.987 4.474-6.241.371-12.712-1.346-14.416-.006-.013-.012-.019-.012-.031-.006.006-.006.006-.006.012 0-.006 0-.006-.007-.012 0 .074-.006.148-.012.223a8.34 8.34 0 0 1-.062.415c-.03.136-.068.273-.105.41-.044.13-.093.266-.15.396a5.322 5.322 0 0 1-.185.378 4.735 4.735 0 0 1-.477.688c-.093.111-.192.21-.292.31a3.994 3.994 0 0 1-.18.155l-.142.124a3.459 3.459 0 0 1-.347.241 4.295 4.295 0 0 1-.366.211c-.13.062-.26.118-.39.174a4.364 4.364 0 0 1-.818.223c-.143.025-.285.037-.422.05a4.914 4.914 0 0 1-.297.012 4.66 4.66 0 0 1-.422-.025 3.137 3.137 0 0 1-.421-.062 3.136 3.136 0 0 1-.415-.105h-.007c.137-.013.273-.025.41-.05a4.493 4.493 0 0 0 .818-.223c.136-.05.266-.112.39-.174.13-.062.248-.13.372-.204.118-.08.235-.161.347-.248.112-.087.217-.18.316-.279.105-.093.198-.198.291-.304.093-.111.18-.223.26-.334.013-.019.026-.044.038-.062.062-.1.124-.199.18-.298a4.272 4.272 0 0 0 .334-.775c.044-.13.075-.266.106-.403.025-.142.05-.278.062-.415.012-.142.025-.285.025-.421 0-.1-.007-.199-.013-.298a6.726 6.726 0 0 0-.05-.415 4.493 4.493 0 0 0-.092-.415c-.044-.13-.087-.267-.137-.397-.05-.13-.111-.26-.173-.384-.069-.124-.137-.248-.211-.366a6.843 6.843 0 0 0-.248-.34c-.093-.106-.186-.212-.285-.317a3.878 3.878 0 0 0-.161-.155c-.28-.217-.57-.421-.862-.607a1.154 1.154 0 0 0-.124-.062 2.415 2.415 0 0 0-.589-.26Z"},cypress:{hex:"69D3A7",path:"M11.998.0195c-.8642 0-1.6816.1101-2.1445.1934v.002C4.1731 1.2283 0 6.1368 0 12.0018c0 1.1265.1573 2.2328.4648 3.3028.0387.1453.0915.2993.1368.4473 1.607 4.865 6.2245 8.226 11.3925 8.2285.0651 0 .2518-.0003.502-.0118.8564-.0353 1.6228-.5734 1.9512-1.369l.4736-1.1544L20.4258 8.043H18.621l-2.3164 5.871-2.334-5.871h-1.9082l3.2734 8.0117c-.8115 1.9702-1.6252 3.9395-2.4355 5.9101-.0808.1945-.2655.3284-.4727.336-.144.005-.285.0098-.4316.0098-4.5848 0-8.6672-3.0695-9.9277-7.4649a10.3058 10.3058 0 0 1-.3985-2.8437c0-5.0887 3.6521-9.3404 8.6035-10.164.2214-.037.8885-.1446 1.7246-.1446 4.4166 0 8.269 2.732 9.7305 6.8476.0558.144.0977.293.1465.4395.299.9746.4531 1.9887.4531 3.0215 0 4.5696-2.9413 8.5326-7.3164 9.8613l.4863 1.5996c5.085-1.546 8.4995-6.1518 8.502-11.459 0-1.5491-.2983-2.8706-.6504-3.8926-.0432-.1212-.0873-.2422-.1309-.3633h-.002C21.4577 3.0954 17.0444.0195 11.998.0195ZM8.4336 7.8906c-1.1999 0-2.1747.3852-2.9805 1.1758-.8007.7856-1.205 1.7736-1.205 2.9356 0 1.1544.4068 2.1368 1.205 2.9199.8058.7906 1.7806 1.1738 2.9805 1.1738 1.705 0 3.1556-.955 3.7871-2.4883l.0332-.082-1.6289-.5547c-.168.4563-.7552 1.4883-2.1914 1.4883-.6745 0-1.2437-.2344-1.6934-.6992-.4572-.4699-.6875-1.0632-.6875-1.7578 0-.6998.2253-1.2809.6875-1.7735.4522-.4648 1.019-.7012 1.6934-.7012 1.438 0 2.0238 1.0815 2.1934 1.4883l1.627-.5527-.0333-.084c-.629-1.5358-2.082-2.4883-3.7871-2.4883Z"},storybook:{hex:"FF4785",path:"M16.71.243l-.12 2.71a.18.18 0 00.29.15l1.06-.8.9.7a.18.18 0 00.28-.14l-.1-2.76 1.33-.1a1.2 1.2 0 011.279 1.2v21.596a1.2 1.2 0 01-1.26 1.2l-16.096-.72a1.2 1.2 0 01-1.15-1.16l-.75-19.797a1.2 1.2 0 011.13-1.27L16.7.222zM13.64 9.3c0 .47 3.16.24 3.59-.08 0-3.2-1.72-4.89-4.859-4.89-3.15 0-4.899 1.72-4.899 4.29 0 4.45 5.999 4.53 5.999 6.959 0 .7-.32 1.1-1.05 1.1-.96 0-1.35-.49-1.3-2.16 0-.36-3.649-.48-3.769 0-.27 4.03 2.23 5.2 5.099 5.2 2.79 0 4.969-1.49 4.969-4.18 0-4.77-6.099-4.64-6.099-6.999 0-.97.72-1.1 1.13-1.1.45 0 1.25.07 1.19 1.87z"},graphql:{hex:"E10098",path:"M12.002 0a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.54 4.931a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm0 9.862a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm-8.54 4.931a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.276zm-8.542-4.93a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.277zm0-9.863a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.542-3.378L2.953 6.777v10.448l9.049 5.224 9.047-5.224V6.777zm0 1.601 7.66 13.27H4.34zm-1.387.371L3.97 15.037V7.363zm2.774 0 6.646 3.838v7.674zM5.355 17.44h13.293l-6.646 3.836z"},trpc:{hex:"2596BE",path:"M24 12c0 6.62-5.38 12-12 12S0 18.62 0 12 5.38 0 12 0s12 5.38 12 12ZM1.21 12A10.78 10.78 0 0 0 12 22.79 10.78 10.78 0 0 0 22.79 12 10.78 10.78 0 0 0 12 1.21 10.78 10.78 0 0 0 1.21 12Zm10.915-6.086 2.162 1.248a.25.25 0 0 1 .125.217v1.103l2.473 1.428a.25.25 0 0 1 .125.217v2.355l.955.551a.25.25 0 0 1 .125.217v2.496a.25.25 0 0 1-.125.217l-2.162 1.248a.25.25 0 0 1-.25 0l-.956-.552-2.472 1.427a.25.25 0 0 1-.25 0l-2.472-1.427-.956.552a.25.25 0 0 1-.25 0l-2.162-1.248a.25.25 0 0 1-.125-.217V13.25a.25.25 0 0 1 .125-.217l.955-.551v-2.355a.25.25 0 0 1 .125-.217l2.473-1.428V7.38a.25.25 0 0 1 .125-.217l2.162-1.248a.25.25 0 0 1 .25 0Zm1.268 10.049a.25.25 0 0 1-.125-.217V13.25a.25.25 0 0 1 .125-.217l2.16-1.248a.25.25 0 0 1 .25 0l.707.408v-1.922l-2.098-1.21v.814a.25.25 0 0 1-.125.217l-2.162 1.248a.25.25 0 0 1-.25 0l-2.162-1.248a.25.25 0 0 1-.125-.217V9.06L7.49 10.271v1.922l.707-.408a.25.25 0 0 1 .25 0l2.16 1.248a.25.25 0 0 1 .125.217v2.496a.25.25 0 0 1-.125.217l-.705.408L12 17.582l2.098-1.211ZM10.088 9.73l1.662.96V8.766l-1.662-.955Zm3.824 0V7.811l-1.662.955v1.924ZM12 6.418l-1.66.96 1.66.954 1.66-.954Zm-5.59 9.184 1.66.958v-1.921l-1.66-.956Zm3.822 0v-1.92l-1.662.957v1.923Zm-1.91-3.311-1.662.96 1.661.955 1.66-.956Zm5.446 3.31 1.66.96v-1.922l-1.66-.956Zm3.822 0v-1.918l-1.662.956v1.922Zm-1.912-3.31-1.66.96 1.66.955 1.66-.956Z"},redux:{hex:"764ABC",path:"M16.634 16.504c.87-.075 1.543-.84 1.5-1.754-.047-.914-.796-1.648-1.709-1.648h-.061a1.71 1.71 0 00-1.648 1.769c.03.479.226.869.494 1.153-1.048 2.038-2.621 3.536-5.005 4.795-1.603.838-3.296 1.154-4.944.93-1.378-.195-2.456-.81-3.116-1.799-.988-1.499-1.078-3.116-.255-4.734.6-1.17 1.499-2.023 2.099-2.443a9.96 9.96 0 01-.42-1.543C-.868 14.408-.416 18.752.932 20.805c1.004 1.498 3.057 2.456 5.304 2.456.6 0 1.23-.044 1.843-.194 3.897-.749 6.848-3.086 8.541-6.532zm5.348-3.746c-2.32-2.728-5.738-4.226-9.634-4.226h-.51c-.253-.554-.837-.899-1.498-.899h-.045c-.943 0-1.678.81-1.647 1.753.03.898.794 1.648 1.708 1.648h.074a1.69 1.69 0 001.499-1.049h.555c2.309 0 4.495.674 6.488 1.992 1.527 1.005 2.622 2.323 3.237 3.897.538 1.288.509 2.547-.045 3.597-.855 1.647-2.294 2.517-4.196 2.517-1.199 0-2.367-.375-2.967-.644-.36.298-.96.793-1.394 1.093 1.318.598 2.652.943 3.94.943 2.922 0 5.094-1.647 5.919-3.236.898-1.798.824-4.824-1.47-7.416zM6.49 17.042c.03.899.793 1.648 1.708 1.648h.06a1.688 1.688 0 001.648-1.768c0-.9-.779-1.647-1.693-1.647h-.06c-.06 0-.15 0-.226.029-1.243-2.098-1.768-4.347-1.572-6.772.12-1.828.72-3.417 1.797-4.735.9-1.124 2.593-1.68 3.747-1.708 3.236-.061 4.585 3.971 4.689 5.574l1.498.45C17.741 3.197 14.686.62 11.764.62 9.02.62 6.49 2.613 5.47 5.535 4.077 9.43 4.991 13.177 6.7 16.174c-.15.195-.24.539-.21.868z"},i18next:{hex:"26A69A",path:"M14.93646 2.48699v4.51684l5.0758 13.03647s1.5495 3.1839-2.8824 3.9597H7.01922s-4.13084-.4311-3.14053-3.7019L9.21276 7.00401V2.48699h5.7237Zm2.0894 13.10781c-4.4301-1.3742-8.15457-.6365-9.97498-.0788l-1.83572 4.4186c-.78296 2.499 2.27302 2.9417 2.59687 2.9813l.02755.0032h8.44448c3.5407-.5982 2.511-2.972 2.4147-3.1773l-.0068-.0142-1.6661-4.1328Zm-7.81345.7772c.78905.0004 1.42905.3862 1.42905.8646 0 .4764-.6404.864-1.42905.864-.7887 0-1.42711-.3878-1.42711-.864 0-.4784.6384-.8646 1.4271-.8646Zm5.08375 0c.7871.0004 1.4271.3862 1.4271.8646 0 .4764-.6403.864-1.4271.864-.791 0-1.429-.3878-1.429-.864 0-.4784.638-.8646 1.429-.8646Zm-4.5001-5.2131c-.55227 0-.99993.5395-.99993 1.2051 0 .6656.44766 1.2051.99993 1.2051.5522 0 .9998-.5395.9998-1.2051 0-.6656-.4476-1.2051-.9998-1.2051Zm3.6413-1.29686c-.6549 0-1.1862.63806-1.1862 1.42906 0 .7871.5313 1.4271 1.1862 1.4271.653 0 1.1862-.64 1.1862-1.4271 0-.7907-.5328-1.42906-1.1862-1.42906Zm6.0363-2.73783s-2.1219 1.54591-4.0858-.41975V4.55615s2.7243-.60065 4.0858 2.56806Zm-14.84367 0C5.9908 3.9555 8.71543 4.55615 8.71543 4.55615v2.14831c-1.96566 1.96566-4.08544.41975-4.08544.41975ZM15.04366 0c.4954 0 .8958.4387.8958.98109 0 .54203-.4006.98074-.8958.98074H8.95478c-.49315 0-.89428-.43871-.89428-.98074C8.0605.43871 8.46146 0 8.95478 0h6.08888Z"},mui:{hex:"007FFF",path:"M20.229 15.793a.666.666 0 0 0 .244-.243.666.666 0 0 0 .09-.333l.012-3.858a.666.666 0 0 1 .09-.333.666.666 0 0 1 .245-.243L23 9.58a.667.667 0 0 1 .333-.088.667.667 0 0 1 .333.09.667.667 0 0 1 .244.243.666.666 0 0 1 .089.333v7.014a.667.667 0 0 1-.335.578l-7.893 4.534a.666.666 0 0 1-.662 0l-6.194-3.542a.667.667 0 0 1-.246-.244.667.667 0 0 1-.09-.335v-3.537c0-.004.004-.006.008-.004s.008 0 .008-.005v-.004c0-.003.002-.005.004-.007l5.102-2.93c.004-.003.002-.01-.003-.01a.005.005 0 0 1-.004-.002.005.005 0 0 1-.001-.004l.01-3.467a.667.667 0 0 0-.333-.58.667.667 0 0 0-.667 0L8.912 9.799a.667.667 0 0 1-.665 0l-3.804-2.19a.667.667 0 0 0-.999.577v6.267a.667.667 0 0 1-.332.577.666.666 0 0 1-.332.09.667.667 0 0 1-.333-.088L.336 13.825a.667.667 0 0 1-.246-.244.667.667 0 0 1-.09-.336L.019 2.292a.667.667 0 0 1 .998-.577l7.23 4.153a.667.667 0 0 0 .665 0l7.228-4.153a.666.666 0 0 1 .333-.088.666.666 0 0 1 .333.09.667.667 0 0 1 .244.244.667.667 0 0 1 .088.333V13.25c0 .117-.03.232-.089.334a.667.667 0 0 1-.245.244l-3.785 2.18a.667.667 0 0 0-.245.245.666.666 0 0 0-.089.334.667.667 0 0 0 .09.334.666.666 0 0 0 .247.244l2.088 1.189a.67.67 0 0 0 .33.087.667.667 0 0 0 .332-.089l4.457-2.56Zm.438-9.828a.666.666 0 0 0 .09.335.666.666 0 0 0 .248.244.667.667 0 0 0 .67-.008l2.001-1.2a.666.666 0 0 0 .237-.243.667.667 0 0 0 .087-.329V2.32a.667.667 0 0 0-.091-.335.667.667 0 0 0-.584-.33.667.667 0 0 0-.334.094l-2 1.2a.666.666 0 0 0-.238.243.668.668 0 0 0-.086.329v2.445Z"},bootstrap:{hex:"7952B3",path:"M11.77 11.24H9.956V8.202h2.152c1.17 0 1.834.522 1.834 1.466 0 1.008-.773 1.572-2.174 1.572zm.324 1.206H9.957v3.348h2.231c1.459 0 2.232-.585 2.232-1.685s-.795-1.663-2.326-1.663zM24 11.39v1.218c-1.128.108-1.817.944-2.226 2.268-.407 1.319-.463 2.937-.42 4.186.045 1.3-.968 2.5-2.337 2.5H4.985c-1.37 0-2.383-1.2-2.337-2.5.043-1.249-.013-2.867-.42-4.186-.41-1.324-1.1-2.16-2.228-2.268V11.39c1.128-.108 1.819-.944 2.227-2.268.408-1.319.464-2.937.42-4.186-.045-1.3.968-2.5 2.338-2.5h14.032c1.37 0 2.382 1.2 2.337 2.5-.043 1.249.013 2.867.42 4.186.409 1.324 1.098 2.16 2.226 2.268zm-7.927 2.817c0-1.354-.953-2.333-2.368-2.488v-.057c1.04-.169 1.856-1.135 1.856-2.213 0-1.537-1.213-2.538-3.062-2.538h-4.16v10.172h4.181c2.218 0 3.553-1.086 3.553-2.876z"},sass:{hex:"CC6699",path:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zM9.615 15.998c.175.645.156 1.248-.024 1.792l-.065.18c-.024.061-.052.12-.078.176-.14.29-.326.56-.555.81-.698.759-1.672 1.047-2.09.805-.45-.262-.226-1.335.584-2.19.871-.918 2.12-1.509 2.12-1.509v-.003l.108-.061zm9.911-10.861c-.542-2.133-4.077-2.834-7.422-1.645-1.989.707-4.144 1.818-5.693 3.267C4.568 8.48 4.275 9.98 4.396 10.607c.427 2.211 3.457 3.657 4.703 4.73v.006c-.367.18-3.056 1.529-3.686 2.925-.675 1.47.105 2.521.615 2.655 1.575.436 3.195-.36 4.065-1.649.84-1.261.766-2.881.404-3.676.496-.135 1.08-.195 1.83-.104 2.101.24 2.521 1.56 2.43 2.1-.09.539-.523.854-.674.944-.15.091-.195.12-.181.181.015.09.091.09.21.075.165-.03 1.096-.45 1.141-1.471.045-1.29-1.186-2.729-3.375-2.7-.9.016-1.471.091-1.875.256-.03-.045-.061-.075-.105-.105-1.35-1.455-3.855-2.475-3.75-4.41.03-.705.285-2.564 4.8-4.814 3.705-1.846 6.661-1.335 7.171-.21.733 1.604-1.576 4.59-5.431 5.024-1.47.165-2.235-.404-2.431-.615-.209-.225-.239-.24-.314-.194-.12.06-.045.255 0 .375.12.3.585.825 1.396 1.095.704.225 2.43.359 4.5-.45 2.324-.899 4.139-3.405 3.614-5.505l.073.067z"},drizzle:{hex:"C5F74F",path:"M5.353 11.823a1.036 1.036 0 0 0-.395-1.422 1.063 1.063 0 0 0-1.437.399L.138 16.702a1.035 1.035 0 0 0 .395 1.422 1.063 1.063 0 0 0 1.437-.398l3.383-5.903Zm11.216 0a1.036 1.036 0 0 0-.394-1.422 1.064 1.064 0 0 0-1.438.399l-3.382 5.902a1.036 1.036 0 0 0 .394 1.422c.506.283 1.15.104 1.438-.398l3.382-5.903Zm7.293-4.525a1.036 1.036 0 0 0-.395-1.422 1.062 1.062 0 0 0-1.437.399l-3.383 5.902a1.036 1.036 0 0 0 .395 1.422 1.063 1.063 0 0 0 1.437-.399l3.383-5.902Zm-11.219 0a1.035 1.035 0 0 0-.394-1.422 1.064 1.064 0 0 0-1.438.398l-3.382 5.903a1.036 1.036 0 0 0 .394 1.422c.506.282 1.15.104 1.438-.399l3.382-5.902Z"},supabase:{hex:"3FCF8E",path:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},firebase:{hex:"DD2C00",path:"M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z"},bun:{hex:"000000",path:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"},deno:{hex:"70FFAF",path:"M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635"},nuxt:{hex:"00DC82",path:"M13.4642 19.8295h8.9218c.2834 0 .5618-.0723.8072-.2098a1.5899 1.5899 0 0 0 .5908-.5732 1.5293 1.5293 0 0 0 .216-.783 1.529 1.529 0 0 0-.2167-.7828L17.7916 7.4142a1.5904 1.5904 0 0 0-.5907-.573 1.6524 1.6524 0 0 0-.807-.2099c-.2833 0-.5616.0724-.807.2098a1.5904 1.5904 0 0 0-.5907.5731L13.4642 9.99l-2.9954-5.0366a1.5913 1.5913 0 0 0-.591-.573 1.6533 1.6533 0 0 0-.8071-.2098c-.2834 0-.5617.0723-.8072.2097a1.5913 1.5913 0 0 0-.591.573L.2168 17.4808A1.5292 1.5292 0 0 0 0 18.2635c-.0001.2749.0744.545.216.783a1.59 1.59 0 0 0 .5908.5732c.2454.1375.5238.2098.8072.2098h5.6003c2.219 0 3.8554-.9454 4.9813-2.7899l2.7337-4.5922L16.3935 9.99l4.3944 7.382h-5.8586ZM7.123 17.3694l-3.9083-.0009 5.8586-9.8421 2.9232 4.921-1.9572 3.2892c-.7478 1.1967-1.5972 1.6328-2.9163 1.6328z"},stripe:{hex:"635BFF",path:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},twilio:{hex:"F22F46",path:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},reactquery:{hex:"FF4154",path:"M6.9297 13.6875c.164-.0938.375-.0352.4687.1328l.0625.1055c.4805.8515.9805 1.6601 1.5 2.4258.6133.9023 1.3047 1.8164 2.0743 2.7421a.3455.3455 0 0 1-.0391.4844l-.0742.0664c-2.543 2.2227-4.1914 2.664-4.9532 1.332-.746-1.3046-.4765-3.6718.8086-7.1093a.3437.3437 0 0 1 .1524-.1797ZM17.75 16.3008c.1836-.0313.3594.086.3945.2695l.0196.1016c.6289 3.2851.1875 4.9297-1.3243 4.9297-1.4804 0-3.3593-1.4024-5.6484-4.2032a.3271.3271 0 0 1-.0742-.2226c0-.1875.1562-.3399.3437-.3399h.1211a32.9838 32.9838 0 0 0 2.8086-.0976c1.0703-.086 2.1914-.2305 3.3594-.4375zm.871-6.9766a.3528.3528 0 0 1 .4454-.211l.1016.0352c3.2617 1.1094 4.5039 2.332 3.7187 3.6641-.7656 1.3047-2.9922 2.254-6.6836 2.8477-.082.0117-.168-.004-.2383-.047-.168-.0976-.2265-.3085-.125-.4765l.0625-.1054c.504-.8438.957-1.6836 1.3672-2.5235.4766-.9883.9297-2.0508 1.3516-3.1836zM7.797 8.3398c.082-.0117.168.004.2383.047.168.0976.2265.3085.125.4765l-.0625.1054a34.0882 34.0882 0 0 0-1.3672 2.5235c-.4766.9883-.9297 2.0508-1.3516 3.1836a.3528.3528 0 0 1-.4453.211l-.1016-.0352c-3.2617-1.1094-4.5039-2.332-3.7187-3.6641.7656-1.3047 2.9922-2.254 6.6836-2.8477Zm5.2812-3.9843c2.543-2.2227 4.1914-2.664 4.9532-1.332.746 1.3046.4765 3.6718-.8086 7.1093a.3436.3436 0 0 1-.1524.1797c-.164.0938-.375.0352-.4687-.1328l-.0625-.1055c-.4805-.8515-.9805-1.6601-1.5-2.4258-.6133-.9023-1.3047-1.8164-2.0743-2.7421a.3455.3455 0 0 1 .0391-.4844Zm-5.793-2.082c1.4805 0 3.3633 1.4023 5.6485 4.203a.3488.3488 0 0 1 .0781.2188c-.0039.1914-.1562.3438-.3476.3438l-.1172-.004a34.5835 34.5835 0 0 0-2.8086.1016c-1.0742.086-2.1953.2305-3.3633.4375a.343.343 0 0 1-.3945-.2734l-.0196-.0977c-.629-3.2851-.1876-4.9297 1.3242-4.9297Zm2.8711 5.8124h3.6875a.638.638 0 0 1 .5508.3164l1.8477 3.2188a.6437.6437 0 0 1 0 .6289l-1.8477 3.2227a.638.638 0 0 1-.5507.3164h-3.6875c-.2266 0-.4375-.1211-.547-.3164L7.7579 12.25a.6437.6437 0 0 1 0-.629l1.8516-3.2187c.1093-.1953.3203-.3164.5468-.3164Zm3.2305.793a.638.638 0 0 1 .5508.3164l1.3906 2.4258a.6437.6437 0 0 1 0 .6289l-1.3906 2.4297a.638.638 0 0 1-.5508.3164h-2.7734c-.2266 0-.4375-.1211-.5469-.3164L8.672 12.25a.6437.6437 0 0 1 0-.629l1.3945-2.4257c.1094-.1953.3203-.3164.5469-.3164Zm-.4922.8672h-1.789c-.2266 0-.4336.1172-.547.3164l-.8983 1.5586a.6437.6437 0 0 0 0 .6289l.8984 1.5625a.6317.6317 0 0 0 .5469.3164h1.789a.6317.6317 0 0 0 .547-.3164l.8983-1.5625a.6437.6437 0 0 0 0-.629l-.8984-1.5585c-.1133-.1992-.3203-.3164-.5469-.3164Zm-.4765.8281c.2265 0 .4375.1211.5468.3164l.422.7305c.1132.1953.1132.4375 0 .6289l-.422.7344c-.1093.1953-.3203.3164-.5468.3164h-.836a.6317.6317 0 0 1-.5468-.3164l-.422-.7344c-.1132-.1914-.1132-.4336 0-.629l.422-.7304a.6317.6317 0 0 1 .5468-.3164zm-.418.8164a.548.548 0 0 0-.4727.2735c-.0976.168-.0976.375 0 .5468a.5444.5444 0 0 0 .4727.2696.5444.5444 0 0 0 .4727-.2696c.0976-.1718.0976-.3789 0-.5468A.548.548 0 0 0 12 11.3906Zm-4.4219.5469h.9805M18.9805 7.75c.3906-1.8945.4765-3.3438.2226-4.3984-.1484-.629-.4218-1.1368-.8398-1.5078-.4414-.3907-1-.582-1.625-.582-1.0352 0-2.1211.4726-3.2813 1.3671-.4726.3633-.9648.8047-1.4726 1.3164-.043-.0508-.086-.1015-.1367-.1445-1.4454-1.2852-2.6602-2.082-3.6993-2.3906-.6171-.1836-1.1953-.1993-1.7226-.0235-.5586.1875-1.004.5742-1.3164 1.1172-.5156.8945-.6524 2.0742-.461 3.5274.0782.5898.2149 1.2343.4024 1.9335a1.1187 1.1187 0 0 0-.2149.047C3.008 8.621 1.711 9.2694.9258 10.0155c-.4649.4414-.7695.9375-.8828 1.4805-.1133.5781 0 1.1562.3125 1.6992.5156.8945 1.4648 1.5977 2.8164 2.1563.543.2226 1.1562.4257 1.8437.6093a1.0227 1.0227 0 0 0-.0703.2266c-.3906 1.8906-.4765 3.3438-.2226 4.3945.1484.629.4257 1.1407.8398 1.5078.4414.3907 1 .582 1.625.582 1.0352 0 2.121-.4726 3.2813-1.3632.4765-.3711.9726-.8164 1.4882-1.336a1.2 1.2 0 0 0 .1953.2266c1.4454 1.2852 2.6602 2.082 3.6993 2.3906.6172.1836 1.1953.1993 1.7226.0235.5586-.1875 1.004-.5742 1.3164-1.1172.5157-.8945.6524-2.0742.461-3.5273-.082-.6133-.2227-1.2813-.4258-2.0118a1.2248 1.2248 0 0 0 .2383-.0468c1.828-.6094 3.125-1.2578 3.9101-2.004.4649-.4413.7696-.9374.8828-1.4804.1133-.5781 0-1.1563-.3125-1.6992-.5156-.8946-1.4648-1.5977-2.8164-2.1563-.5586-.2304-1.1953-.4414-1.9062-.625a.8647.8647 0 0 0 .0586-.1953z"},reacthookform:{hex:"EC5990",path:"M10.7754 17.3477H5.8065a.2815.2815 0 1 0 0 .563h4.9689a.2815.2815 0 1 0 0-.563zm7.3195 0h-4.9688a.2815.2815 0 1 0 0 .563h4.9688a.2815.2815 0 0 0 0-.563zm-7.3336-6.475H5.8065a.2815.2815 0 1 0 0 .563h4.9548a.2815.2815 0 1 0 0-.563zm7.3195 0h-4.9547a.2815.2815 0 1 0 0 .563h4.9547a.2815.2815 0 0 0 0-.563zm.5518-9.2001h-4.341a2.4042 2.4042 0 0 0-4.5804 0H5.3674c-1.7103 0-3.0968 1.3864-3.0968 3.0967v16.134C2.2706 22.6135 3.6571 24 5.3674 24h13.2652c1.7103 0 3.0968-1.3865 3.0968-3.0967V4.7693c0-1.7103-1.3865-3.0967-3.0968-3.0967zm-8.7046.563a.2815.2815 0 0 0 .2815-.2224 1.8411 1.8411 0 0 1 3.5979 0 .2815.2815 0 0 0 .2815.2224h1.5146v1.844a.8446.8446 0 0 1-.8446.8446H9.2552a.8446.8446 0 0 1-.8446-.8446v-1.844Zm11.2383 18.6677c0 1.3993-1.1344 2.5337-2.5337 2.5337H5.3674c-1.3993 0-2.5337-1.1344-2.5337-2.5337V4.7693c0-1.3993 1.1344-2.5337 2.5337-2.5337h2.4802v1.844c0 .7774.6302 1.4076 1.4076 1.4076h5.4896c.7774 0 1.4076-.6302 1.4076-1.4076v-1.844h2.4802c1.3993 0 2.5337 1.1344 2.5337 2.5337z"}},Lf={shipped:"Released",merged:"Merged, not released yet",building:"Being built",designed:"Designed, not built yet",coming:"Coming"};function kL(){const e=O8(),n=ei({from:"/architecture"}),s=Gt(),r=n.view??"map",[i,o]=C.useState(new Set),[l,u]=C.useState(null),[d,p]=C.useState(!1),[f,m]=C.useState(null),x=n.adr?n.adr.startsWith("ADR-")?{kind:"adr",id:n.adr}:{kind:"ticket",id:n.adr}:null,y=q=>void s({to:"/architecture",search:{...(q.view??r)!=="map"?{view:q.view??r}:{},..."pick"in q?q.pick?{adr:q.pick.id}:{}:n.adr?{adr:n.adr}:{}},replace:!0}),j=q=>y({pick:x?.id===q?.id?null:q}),k=e.data?.decisions??[],b=e.data?.tickets??[],S=C.useMemo(()=>FL(k,b),[k,b]),N=S.cols.length,$=l??N;if(C.useEffect(()=>{if(!d)return;const q=setInterval(()=>{u(L=>{const U=(L??0)+1;return U>=N?(p(!1),null):U})},700);return()=>clearInterval(q)},[d,N]),!e.data)return t.jsx("div",{className:"top",children:t.jsx("h1",{children:"Architecture"})});const A=k.filter(q=>S.colOf(q.from)<$),R=A.filter(q=>!q.replacedBy||S.colOf(Dw(k,q.replacedBy))>=$),E=S.cols.slice(0,$).reduce((q,L)=>q+(L.t?.follows.length??0),0),M=f?f.startsWith("ADR-")?{kind:"adr",id:f}:{kind:"ticket",id:f}:x,F=zL(M,k,b),W=r==="map"||r==="timeline",I=e.data.lessons??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Architecture"}),t.jsx("span",{className:"note",children:"Every technical choice the squad made, why, and what it shaped. Every new ticket follows the rules in force."})]}),t.jsx("div",{className:"ptabs",role:"tablist",children:[["map","Map"],["timeline","Timeline"],["stack","Stack",e.data.stack.length],["list","All decisions",k.length],["project","Project map"],["lessons","Lessons",I.length]].map(([q,L,U])=>t.jsxs("button",{role:"tab","aria-selected":r===q,className:r===q?"on":"",onClick:()=>y({view:q}),children:[L," ",U!==void 0&&t.jsx("span",{className:"n",children:U})]},q))}),t.jsxs("div",{className:"split",children:[t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"arch",children:[(e.data?.broken?.length??0)>0&&t.jsx(Oo,{list:e.data.broken,label:"Decisions that could not be read"}),W&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"arch-stats",children:[t.jsx(Pc,{n:R.length,label:"Rules in force",hint:"Every new design must follow these"}),t.jsx(Pc,{n:A.length-R.length,label:"Replaced",hint:"Changed by a newer decision"}),t.jsx(Pc,{n:R.filter(q=>q.checkedBy?.passing).length,label:"Checked by a test",hint:"Break one and nothing ships"}),t.jsx(Pc,{n:E,label:"Times a design followed one",hint:"Past choices shaping new work"})]}),t.jsxs("div",{className:"arch-bar",children:[t.jsxs("button",{className:"btn",onClick:()=>d?p(!1):(u(l===null||l>=N?1:l),p(!0)),children:[d?t.jsx(Pu,{size:14}):t.jsx(Sn,{size:14})," ",d?"Pause":"Play the history"]}),t.jsx("input",{type:"range",min:1,max:N,value:$,"aria-label":"Show the project up to this ticket",onChange:q=>{p(!1);const L=Number(q.target.value);u(L>=N?null:L)}}),t.jsx("span",{className:"note mono",style:{minWidth:110},children:$>=N?"Today":`Up to ${S.cols[$-1]?.label??""}`}),t.jsx("span",{className:"grow"}),[...Qu,"Other"].filter(q=>k.some(L=>(L.area??"Other")===q)).map(q=>t.jsxs("button",{className:`chip area-${q.toLowerCase()} ${i.has(q)?"on":""}`,onClick:()=>o(L=>{const U=new Set(L);return U.has(q)?U.delete(q):U.add(q),U}),children:[t.jsx("i",{})," ",q]},q))]})]}),r==="map"&&t.jsx(CL,{decisions:k.filter(q=>i.size===0||i.has(q.area??"Other")),tickets:b,visible:q=>S.colOf(q.from)<$,related:F,picked:x?.id??null,onPick:j,onHover:m}),r==="timeline"&&t.jsx(EL,{decisions:k,tickets:b,areas:i,shown:$,related:F,picked:x?.id??null,onPick:j,g:S}),W&&t.jsx(SL,{view:r}),r==="map"&&t.jsx(AL,{decisions:k,tickets:b,onPick:j}),r==="stack"&&t.jsx(vL,{data:e.data,picked:x?.id??null,onPick:j}),r==="list"&&t.jsx(PL,{decisions:k,picked:x?.id??null,onPick:j}),r==="project"&&t.jsxs("div",{style:{maxWidth:820},children:[t.jsxs("p",{className:"note",style:{marginBottom:8,display:"flex",gap:8,alignItems:"center"},children:[t.jsx(o8,{size:15})," The Architect writes this from the code and reads it again after every merge. Every agent reads it first, then opens only the files it needs."]}),t.jsx(_w,{reading:e.data.reading}),e.data.map.map(q=>t.jsxs("div",{className:"maprow",children:[t.jsx(D,{as:"b",text:q.area}),t.jsx(D,{text:q.detail})]},q.area))]}),r==="lessons"&&t.jsxs("div",{style:{maxWidth:820},children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:"Learned from bugs and reviews. Each lesson makes the next ticket better."}),I.length===0&&t.jsx("p",{className:"note",children:"No lessons yet."}),I.map(q=>t.jsxs("div",{className:"lesson",children:[t.jsx("span",{className:"glyph sm",children:t.jsx(i8,{size:12})}),t.jsxs(D,{text:q.text,children:[" ",t.jsxs("span",{className:"note",dir:"ltr",children:["From ",q.from]})]}),t.jsx("span",{className:"mono",children:Ws(q.date)})]},q.id))]})]})}),r!=="project"&&r!=="lessons"&&t.jsx(RL,{pick:x,decisions:k,tickets:b,impact:e.data.impact??[],onPick:j})]})]})}const Ow=[{role:"Language",label:"Language and runtime"},{role:"Framework",label:"App framework"},{role:"Interface",label:"Screens"},{role:"Data",label:"Data"},{role:"Services",label:"Outside services"},{role:"Testing",label:"Testing"},{role:"Tooling",label:"Tooling"}];function vL({data:e,picked:n,onPick:s}){const r=e.stack.filter(o=>!o.decisions.length&&!o.via).length,i=e.stack.filter(o=>!o.decisions.length&&o.via).length;return t.jsxs("div",{className:"stackv",children:[t.jsx(_w,{reading:e.reading}),t.jsxs("div",{className:"stack-sum",children:[t.jsxs("span",{children:[t.jsx("b",{children:e.stack.length})," technologies in the code"]}),t.jsxs("span",{children:[t.jsx("b",{children:e.stack.length-r-i})," chosen by a saved decision"]}),i>0&&t.jsxs("span",{children:[t.jsx("b",{children:i})," came with one of those"]}),r>0&&t.jsxs("span",{className:"ahead",children:[t.jsx("b",{children:r})," picked while building, no decision yet"]}),t.jsxs("span",{children:[t.jsx("b",{children:e.patterns.length})," design patterns"]})]}),e.stack.length===0&&t.jsx("p",{className:"note",children:"None found yet. The Architect lists them when it reads the code."}),t.jsxs("section",{className:"stack-group",children:[t.jsx("h3",{children:"Technologies"}),t.jsx("div",{className:"techs",children:Ow.flatMap(o=>e.stack.filter(l=>l.role===o.role)).map(o=>t.jsx(bL,{t:o,picked:n,onPick:s},o.name))})]}),t.jsxs("section",{className:"stack-group",children:[t.jsx("h3",{children:"Design patterns the code follows"}),e.patterns.length===0&&t.jsx("p",{className:"note",children:"Not read yet. Press Read the code again, and the Architect lists the patterns a new developer must keep."}),t.jsx("div",{className:"patterns",children:e.patterns.map(o=>t.jsxs("div",{className:"pattern",children:[t.jsx("span",{className:"glyph sm",children:t.jsx(f8,{size:13})}),t.jsxs("div",{children:[t.jsx(D,{as:"b",text:o.name}),t.jsx(D,{as:"p",text:o.what}),t.jsxs("div",{className:"where",children:[o.where.map(l=>t.jsx("code",{children:l},l)),o.decision&&t.jsxs("button",{className:`pill click ${n===o.decision?"on":""}`,onClick:()=>s({kind:"adr",id:o.decision}),children:["From ",o.decision]})]})]})]},o.name))})]})]})}function bL({t:e,picked:n,onPick:s}){const r=e.icon?jL[e.icon]:void 0;return t.jsxs("div",{className:`tech ${e.decisions.some(i=>i===n)?"picked":""}`,children:[t.jsxs("div",{className:"tech-head",children:[t.jsx("span",{className:"logo",style:r?{"--brand":`#${r.hex}`}:void 0,children:r?t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:NL(r.hex)?"ink":"",children:t.jsx("path",{d:r.path})}):t.jsx("span",{className:"mono",children:e.name.slice(0,2)})}),t.jsxs("span",{className:"tech-name",children:[t.jsx("b",{children:e.name}),e.version&&t.jsxs("span",{className:"mono",children:["v",e.version]})]}),t.jsx("span",{className:"tech-role",children:Ow.find(i=>i.role===e.role)?.label})]}),t.jsx(D,{as:"p",className:e.why?"":"note",text:e.why??"Not explained yet. The Architect fills this in when it reads the code."}),t.jsx("div",{className:"tech-foot",children:e.decisions.length?e.decisions.map(i=>t.jsxs("button",{className:`pill click ${n===i?"on":""}`,onClick:()=>s({kind:"adr",id:i}),children:["Chosen in ",i]},i)):e.via?e.via.decisions.map(i=>t.jsxs("button",{className:`pill click ${n===i?"on":""}`,onClick:()=>s({kind:"adr",id:i}),title:`Choosing ${e.via.name} chose ${e.name} too`,children:["Comes with ",e.via.name," · ",i]},i)):t.jsx(wL,{t:e})})]})}function wL({t:e}){const n=pe(),s=(i,o)=>n.mutate({path:"/api/v1/architecture/decide",body:{tech:e.name,do:i},done:o}),r=e.draft;if(r?.status==="writing"||n.isPending&&!r)return t.jsxs("span",{className:"pill nodecision",children:[t.jsx(pn,{size:12,className:"spin"})," The Architect is writing it"]});if(r?.status==="ready"&&r.decision){const i=r.decision;return t.jsxs("div",{className:"techdraft",children:[t.jsx("span",{className:"lbl",children:"Decision for you to approve"}),t.jsx(D,{as:"b",text:i.title}),t.jsx(D,{as:"p",lead:t.jsx("span",{className:"note",children:"Chosen:"}),text:i.chosen}),t.jsx(D,{as:"p",text:i.why}),i.options.filter(o=>o!==i.chosen).length>0&&t.jsx(D,{as:"p",className:"note",lead:"Also looked at:",text:i.options.filter(o=>o!==i.chosen).join("; ")}),t.jsxs("div",{className:"row",children:[t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>s("approve","Saved as a decision. Every new ticket follows it now."),children:[t.jsx(ge,{size:13})," Approve"]}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>s("discard"),children:"Discard"})]})]})}return t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"pill nodecision",title:r?.status==="failed"?`The last try stopped: ${r.error??""}`:"The Builder added it while building; nobody wrote down why.",children:r?.status==="failed"?"Writing stopped, try again":"Picked while building"}),t.jsx("button",{className:"btn sm",onClick:()=>s("write",`The Architect is writing a decision for ${e.name}.`),children:"Save as a decision"})]})}function NL(e){const n=parseInt(e,16);return(n>>16&255)*.299+(n>>8&255)*.587+(n&255)*.114<60}function _w({reading:e}){const n=pe(),s=e?.status==="pending"||e?.status==="running"||n.isPending;return t.jsxs("div",{className:`reading ${e?.status==="failed"?"bad":""}`,children:[s?t.jsx(pn,{size:15,className:"spin"}):t.jsx(Vr,{size:15}),t.jsx("span",{children:s?"The Architect is reading the code. This takes a minute or two.":e?.status==="failed"?`The last read stopped: ${e.error??"unknown error"}`:e?.at?`Read from the code ${St(e.at)}. It is read again after every merge.`:"Not read from the code yet."}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn sm",disabled:s,onClick:()=>n.mutate({path:"/api/v1/architecture/read",done:"The Architect is reading the code."}),children:[t.jsx(Vr,{size:13})," Read the code again"]})]})}function Pc({n:e,label:n,hint:s}){return t.jsxs("div",{className:"arch-stat",title:s,children:[t.jsx("b",{children:e}),t.jsx("span",{children:n}),t.jsx("small",{children:s})]})}function SL({view:e}){return e==="map"?t.jsxs("div",{className:"arch-legend note",children:[t.jsxs("span",{children:[t.jsx("i",{className:"lg arrow"})," Built on"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg arrow replaces"})," Replaces"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip made"})," Ticket that made it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip"})," Ticket that followed it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip ahead"})," Will follow it, not built yet"]}),t.jsxs("span",{children:[t.jsx(ge,{size:12,strokeWidth:3})," Checked by a test"]})]}):t.jsxs("div",{className:"arch-legend note",children:[t.jsxs("span",{children:[t.jsx("i",{className:"lg node"})," Made the decision"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg dot"})," Its design followed it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg dot open"})," Will follow it, not built yet"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg link"})," Built on an older one"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg link replaces"})," Replaces an older one"]})]})}const Mi=112,Rp=18,no=16,K2=34;function CL({decisions:e,tickets:n,visible:s,related:r,picked:i,onPick:o,onHover:l}){const[u,d]=C.useState(1100),p=C.useRef(null);C.useEffect(()=>{const F=p.current;if(!F)return;const W=new ResizeObserver(()=>d(F.clientWidth));return W.observe(F),()=>W.disconnect()},[]);const f=new Set(e.map(F=>F.id)),m=F=>[...F.buildsOn??[],...F.replaces?[F.replaces]:[]].filter(W=>f.has(W)),x=new Map,y=(F,W=new Set)=>{if(x.has(F.id))return x.get(F.id);if(W.has(F.id))return 0;W.add(F.id);const I=m(F).map(L=>e.find(U=>U.id===L)),q=I.length?1+Math.max(...I.map(L=>y(L,W))):0;return x.set(F.id,q),q},j=[...Qu,"Other"],k=[];for(const F of e)(k[y(F)]??=[]).push(F);const b=k.length>4?30:46,S=Math.max(150,Math.min(270,(u-no*2-Math.max(0,k.length-1)*b)/Math.max(1,k.length)));for(const F of k)F?.sort((W,I)=>j.indexOf(W.area??"Other")-j.indexOf(I.area??"Other")||Y2(W.id)-Y2(I.id));const N=Math.max(1,...k.map(F=>F?.length??0)),$=K2+N*(Mi+Rp)+no,A=new Map;k.forEach((F,W)=>{const I=(N-(F?.length??0))*(Mi+Rp)/2;F?.forEach((q,L)=>A.set(q.id,{x:no+W*(S+b),y:K2+I+L*(Mi+Rp)}))});const R=no*2+k.length*S+Math.max(0,k.length-1)*b,E=F=>r!==null&&!r.has(F),M=["Starting points","Built on them","One more level","And on those","And further"];return t.jsx("div",{className:"dmap",ref:p,onMouseLeave:()=>l(null),children:t.jsxs("div",{className:"dmap-canvas",style:{width:R,height:$},children:[k.map((F,W)=>t.jsx("span",{className:"dmap-layer",style:{left:no+W*(S+b),width:S},children:M[W]??`Level ${W+1}`},W)),t.jsxs("svg",{width:R,height:$,className:"dmap-edges",children:[t.jsxs("defs",{children:[t.jsx("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"arrhead"})}),t.jsx("marker",{id:"arr-r",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"arrhead replaces"})})]}),e.flatMap(F=>{const W=A.get(F.id);return!W||!s(F)?[]:[...(F.buildsOn??[]).map(q=>({p:q,kind:"built"})),...F.replaces?[{p:F.replaces,kind:"replaces"}]:[]].map(({p:q,kind:L})=>{const U=A.get(q),_=e.find(B=>B.id===q);if(!U||!_||!s(_))return null;const G=U.x+S,le=U.y+Mi/2,V=W.x-2,Y=W.y+Mi/2,te=Math.max(40,(V-G)/2),P=r!==null&&r.has(F.id)&&r.has(q);return t.jsx("path",{className:`edge ${L} ${E(F.id)||E(q)?"off":""} ${P?"lit":""}`,d:`M${G} ${le} C${G+te} ${le}, ${V-te} ${Y}, ${V} ${Y}`,markerEnd:`url(#${L==="replaces"?"arr-r":"arr"})`},`${q}-${F.id}-${L}`)})})]}),e.map(F=>{const W=A.get(F.id),I=F.tickets.filter(_=>_!==F.from),q=n.filter(_=>(_.state==="designed"||_.state==="coming")&&_.follows.includes(F.id)&&!I.includes(_.id)),L=[F.from==="Project scan"?"Scan":F.from,...I],U=L.length+q.length-6;return t.jsxs("button",{className:`dcard area-${(F.area??"Other").toLowerCase()} ${s(F)?"":"later"} ${E(F.id)?"off":""} ${i===F.id?"picked":""} ${F.replacedBy?"old":""}`,style:{left:W.x,top:W.y,width:S,height:Mi},onClick:()=>o({kind:"adr",id:F.id}),onMouseEnter:()=>l(F.id),children:[t.jsxs("span",{className:"dhead",children:[t.jsx("i",{}),t.jsx("span",{className:"mono",children:F.id}),t.jsx("span",{className:"darea",children:F.area??"Other"}),F.checkedBy?.passing&&t.jsx(ge,{size:13,strokeWidth:3,className:"dtest","aria-label":"Checked by a test"})]}),t.jsx(D,{as:"b",className:"dtitle",text:F.title}),t.jsx("span",{className:"dchips",children:F.replacedBy?t.jsxs("span",{className:"dchip ahead",children:["Replaced by ",F.replacedBy]}):t.jsxs(t.Fragment,{children:[L.slice(0,6).map((_,G)=>t.jsx("span",{className:`dchip ${G===0?"made":""}`,title:G===0?"Made this decision":"Its design followed it",children:_},_)),q.slice(0,Math.max(0,6-L.length)).map(_=>t.jsx("span",{className:"dchip ahead",title:"Designed, not built yet: will follow it",children:_.id},_.id)),U>0&&t.jsxs("span",{className:"dchip",children:["+",U]})]})})]},F.id)})]})})}const Ip=30,$L=26,Rc=250,TL=62;function EL({decisions:e,areas:n,shown:s,related:r,picked:i,onPick:o,g:l}){const[u,d]=C.useState(1e3),p=C.useRef(null);C.useEffect(()=>{const E=p.current;if(!E)return;const M=new ResizeObserver(()=>d(E.clientWidth));return M.observe(E),()=>M.disconnect()},[]);const f=l.cols.length,m=Math.max(40,Math.min(64,(u-Rc-24)/Math.max(1,f))),x=l.rows.filter(E=>n.size===0||n.has(E.area)),y=new Map;let j=TL+8,k="";const b=[];for(const E of x)E.area!==k&&(k=E.area,j+=$L,b.push({area:E.area,y:j-18})),y.set(E.d.id,j),j+=Ip;const S=j+12,N=Rc+f*m+16,$=E=>Rc+E*m+m/2,A=E=>E<s,R=E=>r!==null&&!r.has(E);return t.jsx("div",{className:"arch-graph",ref:p,children:t.jsxs("svg",{width:N,height:S,role:"img","aria-label":"Decisions over time, and the tickets that followed them",children:[l.cols.map((E,M)=>t.jsxs("g",{className:`col state-${E.t?.state??"scan"} ${A(M)?"":"later"} ${R(E.key)?"dim":""}`,onClick:()=>E.t&&o({kind:"ticket",id:E.key}),children:[t.jsx("rect",{className:"colbg",x:Rc+M*m+2,y:6,width:m-4,height:S-12,rx:10}),t.jsx("text",{className:"colid",x:$(M),y:26,textAnchor:"middle",children:E.label}),t.jsx("circle",{className:"colstate",cx:$(M),cy:42,r:4}),t.jsx("title",{children:E.t?`${E.t.id} · ${E.t.title}
665
+ ${Lf[E.t.state]}`:"What the Architect found when it first read the project"})]},E.key)),b.map(E=>t.jsx("text",{className:`lane area-${E.area.toLowerCase()}`,x:14,y:E.y,children:E.area.toUpperCase()},E.area)),x.map(E=>{const M=y.get(E.d.id),F=l.colOf(E.d.from);if(!A(F))return null;const W=E.d.replacedBy?l.colOf(Dw(e,E.d.replacedBy)):f-1,I=Math.min(W,s-1),q=`track area-${E.area.toLowerCase()} ${R(E.d.id)?"dim":""} ${i===E.d.id?"picked":""}`;return t.jsxs("g",{className:q,onClick:()=>o({kind:"adr",id:E.d.id}),children:[t.jsx("rect",{className:"hit",x:0,y:M-Ip/2,width:N,height:Ip}),t.jsxs("text",{className:"name",x:14,y:M+4,children:[t.jsx("tspan",{className:"rid",children:E.d.id})," ",as(LL(E.d.title,28))]}),t.jsx("line",{className:`rail ${E.d.replacedBy&&W<s?"gone":""}`,x1:$(F),x2:$(I)+(E.d.replacedBy?0:m/2),y1:M,y2:M}),l.cols.map((L,U)=>U>F&&A(U)&&L.t?.follows.includes(E.d.id)?t.jsx("circle",{className:`dot ${L.t.state==="designed"||L.t.state==="coming"?"open":""}`,cx:$(U),cy:M,r:5,children:t.jsx("title",{children:`${L.t.id} followed ${E.d.id}`})},L.key):null),t.jsx("circle",{className:`node ${E.d.replacedBy?"old":""}`,cx:$(F),cy:M,r:8}),E.d.checkedBy?.passing&&t.jsx("path",{className:"tick",d:`M${$(F)-3.5} ${M} l2.5 2.6 l4.8 -5`}),t.jsx("title",{children:`${E.d.id} · ${E.d.title}
666
+ Chosen: ${E.d.chosen}`})]},E.d.id)}),x.flatMap(E=>{const M=y.get(E.d.id),F=l.colOf(E.d.from);return A(F)?[...(E.d.buildsOn??[]).map(I=>({b:I,kind:"built"})),...E.d.replaces?[{b:E.d.replaces,kind:"replaces"}]:[]].map(({b:I,kind:q})=>{const L=y.get(I);if(L===void 0)return null;const U=M>L?1:-1;return t.jsxs("g",{className:`link ${q} ${R(E.d.id)||R(I)?"dim":""}`,children:[t.jsx("path",{d:`M${$(F)} ${L+6*U} L${$(F)} ${M-9*U}`}),t.jsx("circle",{cx:$(F),cy:L,r:3.2})]},`${E.d.id}-${I}-${q}`)}):[]})]})})}function AL({decisions:e,tickets:n,onPick:s}){return t.jsxs("div",{className:"arch-cards",children:[t.jsxs("div",{className:"arch-card",children:[t.jsx("h4",{children:"What a new ticket inherits today"}),t.jsx("p",{className:"note",children:"The Architect, the Builder and the Reviewer read all of these before they start."}),[...Qu,"Other"].map(r=>{const i=e.filter(o=>!o.replacedBy&&(o.area??"Other")===r);return i.length?t.jsxs("div",{className:`inherit area-${r.toLowerCase()}`,children:[t.jsxs("b",{children:[t.jsx("i",{})," ",r]}),i.map(o=>t.jsx("button",{...De(o.title),onClick:()=>s({kind:"adr",id:o.id}),children:t.jsx(D,{lead:t.jsx("span",{className:"mono",children:o.id}),text:o.title})},o.id))]},r):null})]}),t.jsxs("div",{className:"arch-card",children:[t.jsx("h4",{children:"Coming next"}),t.jsx("p",{className:"note",children:"Tickets not built yet, and the past decisions that will shape them."}),n.filter(r=>r.state==="designed"||r.state==="coming").map(r=>t.jsxs("div",{className:"coming",children:[t.jsx("button",{...De(r.title),onClick:()=>s({kind:"ticket",id:r.id}),children:t.jsx(D,{lead:t.jsx("span",{className:"mono",children:r.id}),text:r.title})}),t.jsx("span",{className:"pills",children:r.follows.length?r.follows.map(i=>t.jsx("button",{className:"pill click",onClick:()=>s({kind:"adr",id:i}),children:i},i)):t.jsxs("span",{className:"note",children:["Not designed yet. Will read the ",e.filter(i=>!i.replacedBy).length," rules in force."]})})]},r.id))]})]})}function PL({decisions:e,picked:n,onPick:s}){return t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:90},children:"ID"}),t.jsx("th",{children:"Decision"}),t.jsx("th",{style:{width:110},children:"Area"}),t.jsx("th",{style:{width:120},children:"From"}),t.jsx("th",{style:{width:150},children:"Checked by"})]})}),t.jsx("tbody",{children:[...e].reverse().map(r=>t.jsxs("tr",{className:`click ${n===r.id?"on":""}`,onClick:()=>s({kind:"adr",id:r.id}),children:[t.jsx("td",{className:"mono",children:r.id}),t.jsxs("td",{style:{fontWeight:n===r.id?600:500,color:r.replacedBy?"var(--dim)":void 0},...De(r.title),children:[r.replacedBy?t.jsx("s",{children:t.jsx(Kt,{text:r.title,dir:De(r.title).dir})}):t.jsx(Kt,{text:r.title,dir:De(r.title).dir})," ",r.replacedBy&&t.jsxs("span",{className:"pill wait",children:["Replaced by ",r.replacedBy]})]}),t.jsx("td",{children:t.jsxs("span",{className:`areatag area-${(r.area??"Other").toLowerCase()}`,children:[t.jsx("i",{})," ",r.area??"Other"]})}),t.jsx("td",{style:{color:"var(--muted)",fontSize:13},children:r.from}),t.jsx("td",{children:r.checkedBy?r.checkedBy.passing?t.jsxs("span",{className:"pill ok",children:[t.jsx(ge,{size:13,strokeWidth:2.5})," A ",r.checkedBy.kind]}):t.jsx("span",{className:"pill you",children:"Test being written"}):t.jsx("span",{className:"pill wait",children:"Not checkable"})})]},r.id))})]})}function RL({pick:e,decisions:n,tickets:s,impact:r,onPick:i}){const o=m=>t.jsx("button",{className:"pill click",onClick:()=>i({kind:"adr",id:m}),children:m},m),l=m=>{const x=s.find(y=>y.id===m);return t.jsx("button",{className:`pill click st-${x?.state??"shipped"}`,title:x?`${x.title} · ${Lf[x.state]}`:m,onClick:()=>i({kind:"ticket",id:m}),children:m},m)};if(e?.kind==="ticket"){const m=s.find(x=>x.id===e.id);return m?t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsxs("span",{className:"note mono",children:[m.id," · ",Lf[m.state],m.release?` · ${m.release}`:""]}),t.jsx(D,{as:"h3",text:m.title}),t.jsx("div",{className:"lbl",children:"Decision it made"}),m.made?t.jsx(D,{as:"p",style:{fontSize:13.5},lead:o(m.made),text:n.find(x=>x.id===m.made)?.title??""}):t.jsx("p",{className:"note",children:"None. It worked inside the rules it had."}),t.jsx("div",{className:"lbl",children:"Past decisions its design followed"}),m.follows.length?t.jsx("div",{className:"pills",children:m.follows.map(o)}):t.jsx("p",{className:"note",children:m.state==="coming"?"Not designed yet. When it is, it reads every rule in force.":"None recorded."}),t.jsx("p",{style:{marginTop:18},children:t.jsx(Ce,{to:"/board",search:{ticket:m.id},className:"btn",children:"Open the ticket"})})]}):t.jsx("aside",{className:"sidepanel arch-side",children:t.jsx("p",{className:"note",children:"That ticket is not on this board."})})}const u=e?.kind==="adr"?n.find(m=>m.id===e.id):void 0;if(!u)return t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsx("span",{className:"note mono",children:"HOW IT WORKS"}),t.jsx("h3",{children:"Every choice is remembered"}),t.jsx("p",{style:{fontSize:13.5,marginTop:8},children:"When a ticket needs a technical choice, the Architect writes it with the options and the why. You approve it with the design. From then on it is a rule: every later ticket reads it, and the tickets whose design used it are linked here."}),t.jsx("p",{style:{fontSize:13.5,marginTop:10},children:"A new decision can build on an older one, or replace it. A replaced decision stops being a rule, but its history stays."}),t.jsx("p",{className:"note",style:{marginTop:14},children:"Point at a decision to light up what it touched. Click it for the full story. Press Play to watch the project grow."})]});const d=n.filter(m=>m.buildsOn?.includes(u.id)),p=u.tickets.filter(m=>m!==u.from),f=s.filter(m=>(m.state==="designed"||m.state==="coming")&&m.follows.includes(u.id)&&!p.includes(m.id));return t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsxs("span",{className:"note mono",children:[u.id," · ",u.area??"Other"," · ",u.proposed?"found in the code, not approved yet":t.jsxs(t.Fragment,{children:["approved by ",t.jsx(D,{text:u.approvedBy})]})," · ",Ws(u.date)]}),t.jsx(D,{as:"h3",text:u.title}),u.proposed&&t.jsxs("div",{className:"box",style:{borderColor:"var(--you-line)",background:"var(--you-soft)",marginTop:8},children:[t.jsx("b",{children:"Proposed, not a rule yet."})," It becomes one when you approve the ",t.jsx(Ce,{to:"/overview",children:"Overview"}),"."]}),u.replacedBy&&t.jsxs("div",{className:"box",style:{borderColor:"var(--you-line)",background:"var(--you-soft)",marginTop:8},children:[t.jsx("b",{children:"No longer a rule."})," Replaced by ",o(u.replacedBy),"."]}),t.jsx("div",{className:"lbl",children:"Chosen"}),t.jsx(D,{as:"p",style:{fontSize:13.5,fontWeight:600},text:u.chosen}),t.jsx("div",{className:"lbl",children:"Why"}),t.jsx(D,{as:"p",style:{fontSize:13.5},text:u.why}),u.options.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Also looked at"}),u.options.filter(m=>m!==u.chosen).map(m=>t.jsx(D,{as:"p",className:"note",style:{fontSize:13},text:m},m))]}),t.jsx("div",{className:"lbl",children:"Where it came from"}),t.jsxs("div",{className:"pills",style:{alignItems:"center"},children:[u.from==="Project scan"?t.jsx("span",{className:"pill",children:"Project scan"}):l(u.from),(u.buildsOn??[]).length>0&&t.jsx("span",{className:"note",children:"built on"}),(u.buildsOn??[]).map(o),u.replaces&&t.jsx("span",{className:"note",children:"replaces"}),u.replaces&&o(u.replaces)]}),t.jsx("div",{className:"lbl",children:"What it shaped"}),p.length||d.length?t.jsxs(t.Fragment,{children:[p.length>0&&t.jsx("p",{className:"note",style:{marginBottom:6},children:"Tickets whose design followed it"}),t.jsx("div",{className:"pills",children:p.map(l)}),d.length>0&&t.jsx("p",{className:"note",style:{margin:"10px 0 6px"},children:"Decisions built on it"}),t.jsx("div",{className:"pills",children:d.map(m=>o(m.id))})]}):t.jsx("p",{className:"note",children:"Nothing yet. Every new ticket reads it."}),f.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Still ahead"}),t.jsx("p",{className:"note",style:{marginBottom:6},children:"Designed, not built yet. They will follow it."}),t.jsx("div",{className:"pills",children:f.map(m=>l(m.id))})]}),t.jsx(IL,{d:u,check:r.find(m=>m.adr===u.id),tk:l}),t.jsx("div",{className:"lbl",children:"Checked by"}),u.checkedBy?t.jsxs("div",{className:"box",children:[t.jsx("b",{style:{color:u.checkedBy.passing?"var(--accent)":"var(--you-ink)"},children:u.checkedBy.passing?"Passing":"Being written"})," ",t.jsx("span",{className:"mono",style:{fontSize:12},children:u.checkedBy.name}),t.jsx("p",{className:"note",style:{marginTop:4},children:"If someone breaks this decision, the checks fail and nothing ships."})]}):t.jsx("p",{className:"note",children:"A fact about the project, nothing to test."})]})}function IL({d:e,check:n,tk:s}){const r=pe();if(e.replacedBy)return null;const i=n?.status==="pending"||n?.status==="running"||r.isPending,o=()=>r.mutate({path:"/api/v1/architecture/impact",body:{adr:e.id},done:`The Architect is checking the open tickets against ${e.id}.`});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Tickets planned before it"}),i?t.jsxs("p",{className:"note",style:{display:"flex",gap:8,alignItems:"center"},children:[t.jsx(pn,{size:13,className:"spin"})," The Architect is checking the open tickets."]}):n?.status==="done"?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",style:{marginBottom:6},children:n.checked?.length?`Checked ${n.checked.length} open ${n.checked.length===1?"ticket":"tickets"} ${n.at?St(n.at):""}. ${n.affected?.length?"These need a change, waiting for you:":"None need a change."}`:"No open ticket was planned before it."}),t.jsx("div",{className:"pills",children:(n.affected??[]).map(s)}),t.jsx("button",{className:"btn sm quiet",style:{marginTop:8},onClick:o,children:"Check again"})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:n?.status==="failed"?`The last check stopped: ${n.error??""}`:"Not checked yet. Plans written before it may still do it the old way."}),t.jsx("button",{className:"btn sm",onClick:o,children:"Check open tickets"})]})]})}function FL(e,n){const s=[];e.some(l=>!n.some(u=>u.id===l.from))&&s.push({key:"scan",label:"Scan"});for(const l of n)s.push({key:l.id,label:l.id,t:l});const r=l=>{const u=s.findIndex(d=>d.key===l);return u<0?0:u},i=[...Qu,"Other"],o=e.map(l=>({d:l,area:l.area??"Other"})).sort((l,u)=>i.indexOf(l.area)-i.indexOf(u.area)||r(l.d.from)-r(u.d.from));return{cols:s,rows:o,colOf:r}}function Dw(e,n){return e.find(s=>s.id===n)?.from??""}function zL(e,n,s){if(!e)return null;const r=new Set([e.id]),i=u=>[...u.buildsOn??[],...u.replaces?[u.replaces]:[]];if(e.kind==="ticket"){const u=s.find(d=>d.id===e.id);for(const d of u?.follows??[])r.add(d);return u?.made&&r.add(u.made),r}const o=[e.id];for(;o.length;){const u=o.pop(),d=n.find(p=>p.id===u);for(const p of d?i(d):[])r.has(p)||(r.add(p),o.push(p))}const l=[e.id];for(;l.length;){const u=l.pop();for(const d of n)i(d).includes(u)&&!r.has(d.id)&&(r.add(d.id),l.push(d.id))}for(const u of[...r]){const d=n.find(p=>p.id===u);if(d&&u===e.id)for(const p of d.tickets)r.add(p);d&&r.add(d.from)}for(const u of s)u.follows.includes(e.id)&&r.add(u.id);return r}function LL(e,n){return e.length>n?`${e.slice(0,n-1).trimEnd()}…`:e}function Y2(e){return Number(e.replace(/\D/g,""))||0}function Zu(){return $e({queryKey:["sandbox"],queryFn:()=>Se("/api/v1/sandbox")})}function Bw(){const e=Zu(),n=e.data?.note;return t.jsxs(t.Fragment,{children:[n&&t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:t.jsx(rm,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:n.title}),t.jsx("br",{}),t.jsx("span",{className:"note",children:n.text})]}),t.jsx("span",{className:"pill wait",children:"Less protected"})]}),(e.data?.tools??[]).map(s=>t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:s.available?t.jsx(iu,{size:18}):t.jsx(ry,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:"The guard for the Builder and Tester"}),t.jsx("br",{}),s.available?t.jsxs("span",{className:"note",children:["Their commands run in ",s.why,": they write only in the ticket's copy, the proof folder and temp folders, reach only package registries and the websites you allow under Safety, and never read your keys, sign-ins or .env files."]}):t.jsxs("span",{className:"note",children:["Not available on this computer: ",s.why,". The Builder and Tester run as before, kept in their lane by squad-kit's own checks.",s.fix?` To turn it on: ${s.fix}.`:""]})]}),t.jsx("span",{className:`pill ${s.available?"ok":"wait"}`,children:s.available?"On":"Not available"})]},s.tool)),e.data?.guard&&t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:e.data.guard.on?t.jsx(iu,{size:18}):t.jsx(ry,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:"Guard for the project's own commands"}),t.jsx("br",{}),e.data.guard.on?t.jsxs("span",{className:"note",children:["The project's own tests, setup and app run in ",e.data.guard.why,": they work normally and can reach the internet for packages and tests, but they cannot read your keys, sign-ins, squad-kit's own folder or the project's .env files. An engineer can allow a file they truly need in Settings."]}):t.jsxs("span",{className:"note",children:["Not available on this computer: ",e.data.guard.why,". The project's tests, setup and app run as before.",e.data.guard.fix?` To turn it on: ${e.data.guard.fix}.`:""]})]}),t.jsx("span",{className:`pill ${e.data.guard.on?"ok":"wait"}`,children:e.data.guard.on?"On":"Not available"})]}),e.data&&e.data.tools.some(s=>!s.available)&&t.jsx("div",{style:{marginTop:8},children:t.jsx(re,{text:"squad doctor"})})]})}function ML({hosts:e}){const n=pe(),s=Zu(),[r,i]=C.useState(""),o=(d,p)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{allowedHosts:d},done:p},{onSuccess:()=>i("")}),l=()=>{const d=r.trim();d&&!n.isPending&&o([...e,d],`The squad may reach ${d} from its next step`)},u=s.data?.tools.length?s.data.tools.every(d=>!d.available):!1;return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:"Websites the squad may reach"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[t.jsxs("span",{className:"note",children:["Allow a website here when the project needs one, for example your company's package server. The whole team shares this list.",u?" This computer has no guard for them, so here they can reach any website.":""]}),e.length>0&&t.jsx("span",{className:"pills",children:e.map(d=>t.jsxs("span",{className:"pill mono",children:[d,t.jsx("button",{className:"linkbtn","aria-label":`Stop allowing ${d}`,title:`Stop allowing ${d}`,disabled:n.isPending,onClick:()=>o(e.filter(p=>p!==d),`The squad no longer reaches ${d}`),children:t.jsx(Qe,{size:12})})]},d))}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{fontSize:13,flex:"1 1 200px",minWidth:0},value:r,placeholder:"packages.example.com","aria-label":"A website to allow",onChange:d=>i(d.target.value),onKeyDown:d=>d.key==="Enter"&&l()}),t.jsx("button",{className:"btn sm",disabled:!r.trim()||n.isPending,onClick:l,children:"Allow"})]}),t.jsx(re,{text:`squad config set hosts ${[...e,r.trim()].filter(Boolean).join(" ")||"nexus.example.com"}`})]})]})}function qL(){const e=pe(),s=Zu().data?.guard,[r,i]=C.useState(""),[o,l]=C.useState("");if(!s?.on)return null;const u=(p,f,m)=>e.mutate({path:"/api/v1/settings",method:"PUT",body:{guard:{allowRead:s.allowRead,allowWrite:s.allowWrite,...p}},done:f},{onSuccess:m}),d=(p,f,m,x)=>{const y=p==="read"?"allowRead":"allowWrite",j=()=>m.trim()&&!e.isPending&&u({[y]:[...f,m.trim()]},`The project's commands may ${p} ${m.trim()}`,()=>x("")),k=b=>u({[y]:f.filter(S=>S!==b)},`No longer allowed to ${p} ${b}`,()=>{});return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:p==="read"?"Also read":"Also write"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[t.jsxs("span",{className:"note",children:[p==="read"?"Files or folders the project needs to read":"Folders the project needs to write in"," outside its copy, such as"," ",t.jsx("span",{className:"mono",children:"~/shared"}),". Add one only when a check stopped because squad-kit blocked a file the project truly needs."]}),f.length>0&&t.jsx("span",{className:"pills",children:f.map(b=>t.jsxs("span",{className:"pill mono",children:[b,t.jsx("button",{className:"linkbtn","aria-label":`Stop allowing ${b}`,title:`Stop allowing ${b}`,disabled:e.isPending,onClick:()=>k(b),children:t.jsx(Qe,{size:12})})]},b))}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{fontSize:13,flex:"1 1 200px",minWidth:0},value:m,placeholder:"~/shared","aria-label":`A path to ${p}`,onChange:b=>x(b.target.value),onKeyDown:b=>b.key==="Enter"&&j()}),t.jsx("button",{className:"btn sm",disabled:!m.trim()||e.isPending,onClick:j,children:"Allow"})]}),t.jsx(re,{text:`squad config set allow-${p} ${[...f,m.trim()].filter(Boolean).join(" ")||"~/shared"}`})]})]})};return t.jsxs(t.Fragment,{children:[d("read",s.allowRead,r,i),d("write",s.allowWrite,o,l)]})}const Ww=e=>e==="."?"The project folder":e??"";function OL(e){return{name:e.name,shared:!!e.shared,repo:e.repo??"",folder:e.folder??"",url:e.url??"",needs:e.needs,off:!!e.off}}function Uw({form:e,set:n,others:s,repos:r,isNew:i}){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Name"}),t.jsx("input",{className:"input","aria-label":"Name",dir:xe(e.name),value:e.name,placeholder:"Web app",onChange:o=>n({...e,name:o.target.value})})]}),i&&t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Kind"}),t.jsxs("div",{className:"seg",style:{justifySelf:"start"},children:[t.jsx("button",{className:e.shared?"":"on",onClick:()=>n({...e,shared:!1}),children:"A part that runs by itself"}),t.jsx("button",{className:e.shared?"on":"",onClick:()=>n({...e,shared:!0}),children:"A service the parts share"})]})]}),!e.shared&&t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Where"}),t.jsxs("div",{className:"part-where",children:[t.jsxs("select",{className:"input mono","aria-label":"Repo",value:e.repo,onChange:o=>n({...e,repo:o.target.value}),children:[!e.repo&&t.jsx("option",{value:"",children:"Pick a repo"}),r.map(o=>t.jsx("option",{value:o,children:Ww(o)},o))]}),t.jsx("input",{className:"input mono","aria-label":"Folder inside the repo",value:e.folder,placeholder:"Folder inside it, if any",onChange:o=>n({...e,folder:o.target.value})})]})]}),t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Address"}),t.jsx("input",{className:"input mono","aria-label":"Address",value:e.url,placeholder:"http://localhost:5180",onChange:o=>n({...e,url:o.target.value})})]}),t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Cannot run without"}),t.jsxs("div",{className:"part-needs",children:[s.length===0&&t.jsx("span",{className:"note",children:"Nothing else yet."}),s.map(o=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:e.needs.includes(o.id),onChange:l=>n({...e,needs:l.target.checked?[...e.needs,o.id]:e.needs.filter(u=>u!==o.id)})}),o.name]},o.id))]})]}),!i&&t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Not used"}),t.jsxs("label",{className:"part-off",children:[t.jsx("input",{type:"checkbox",checked:e.off,onChange:o=>n({...e,off:o.target.checked})}),"No story starts it, like an old app or another product in this folder"]})]})]})}function _L({part:e,view:n}){const s=pe(),[r,i]=C.useState(null),o=n.parts.filter(p=>p.id!==e.id&&(!p.off||e.needs.includes(p.id))),l=e.needs.map(p=>n.parts.find(f=>f.id===p)?.name??p),u=e.shared?"Shared by the parts":[Ww(e.repo),e.folder].filter(Boolean).join(" / "),d=()=>s.mutate({path:`/api/v1/parts/${encodeURIComponent(e.id)}`,method:"PUT",body:r,done:`Saved ${r.name}`},{onSuccess:()=>i(null)});return t.jsxs("div",{className:`part-row ${e.off?"off":""}`,children:[t.jsxs("div",{className:"part-head",children:[t.jsxs("div",{className:"grow",children:[t.jsx(D,{as:"b",text:e.name}),e.off&&t.jsx("span",{className:"pill sm",style:{marginLeft:8},children:"Not used"}),e.noRun&&!e.off&&t.jsx("span",{className:"pill sm",style:{marginLeft:8},children:"Nothing starts here"}),t.jsx("div",{className:"note",children:[u,e.url,l.length>0?`Needs ${l.join(", ")}`:""].filter(Boolean).join(" · ")})]}),!r&&t.jsx("button",{className:"btn sm",onClick:()=>i(OL(e)),children:"Correct"})]}),r&&t.jsxs("div",{className:"part-form",children:[t.jsx(Uw,{form:r,set:i,others:o,repos:n.repos,isNew:!1}),t.jsxs("div",{className:"part-acts",children:[t.jsx("button",{className:"btn pri sm",disabled:s.isPending,onClick:d,children:"Save"}),t.jsx("button",{className:"btn sm",onClick:()=>i(null),children:"Cancel"}),t.jsx("span",{className:"grow"}),e.byHand&&t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/parts/${encodeURIComponent(e.id)}/remove`,done:`Took out ${e.name}`},{onSuccess:()=>i(null)}),children:"Take it out"})]})]})]})}function DL({view:e}){const n=pe(),s={name:"",shared:!1,repo:e.repos.length===1?e.repos[0]:"",folder:"",url:"",needs:[],off:!1},[r,i]=C.useState(null);return r?t.jsx("div",{className:"part-row",children:t.jsxs("div",{className:"part-form",children:[t.jsx(Uw,{form:r,set:i,others:e.parts.filter(o=>!o.off),repos:e.repos,isNew:!0}),t.jsxs("div",{className:"part-acts",children:[t.jsx("button",{className:"btn pri sm",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/parts",body:r,done:`Added ${r.name}`},{onSuccess:()=>i(null)}),children:"Add it"}),t.jsx("button",{className:"btn sm",onClick:()=>i(null),children:"Cancel"})]})]})}):t.jsx("button",{className:"btn sm",onClick:()=>i(s),children:"Add a part"})}function BL(){const e=Ke(),n=pe(),s=e.data?.ready?e.data.meta.atOnce:void 0,r=i=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{atOnce:i},done:i?`${i===1?"One story":`${i} stories`} of this project run at once`:"This project follows the limit every project shares"});return t.jsxs("div",{className:"maprow part-f",style:{marginTop:10},children:[t.jsx("b",{children:"Stories at once"}),t.jsxs("div",{className:"seg",style:{justifySelf:"start"},children:[t.jsx("button",{className:s===void 0?"on":"",onClick:()=>r(null),children:"As for all projects"}),[1,2,3].map(i=>t.jsx("button",{className:s===i?"on":"",onClick:()=>r(i),children:i},i))]})]})}function WL(){const e=Ke(),n=pe(),s=e.data?.ready?e.data.meta.delivery:void 0,r=(i,o)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{delivery:i},done:o});return t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"How work goes out"}),t.jsxs("div",{className:"seg",style:{justifySelf:"start"},children:[t.jsx("button",{className:s===void 0?"on":"",onClick:()=>r(null,"Finished work goes out by pull request when a code host is signed in"),children:"Pull request if signed in"}),t.jsx("button",{className:s==="push"?"on":"",onClick:()=>r("push","Finished work goes out pushed to the branch, as one plain commit per story"),children:"Push, one plain commit"})]})]})}function UL(){const n=$e({queryKey:["parts"],queryFn:()=>Se("/api/v1/parts")}).data;return n?.several?t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"What the product is made of"}),t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:"For engineers. The Architect found these when it read the project, and a new read keeps what you correct here. A story only starts the parts it needs."}),n.parts.map(s=>t.jsx(_L,{part:s,view:n},s.id)),t.jsxs("div",{className:"part-add",children:[t.jsx(DL,{view:n}),t.jsx(re,{text:"squad parts"})]}),t.jsx(BL,{}),t.jsx(WL,{})]}):null}const uo="/api/v1/project-files";function Hw({f:e,many:n,children:s}){const r=pe();return t.jsx("div",{className:"part-row",children:t.jsxs("div",{className:"part-head",children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{className:"mono",style:{fontSize:13},children:n?`${e.repo}/${e.path}`:e.path}),s]}),t.jsx("button",{className:"btn sm",disabled:r.isPending,onClick:()=>r.mutate({path:`${uo}/remove`,body:e,done:`${e.path} is off the list`}),children:"Take it off"})]})})}function HL({f:e,many:n}){const s=pe();return t.jsxs(Hw,{f:e,many:n,children:[e.ready?t.jsx("span",{className:"pill ok sm",style:{marginLeft:8},children:"Ready"}):t.jsx("span",{className:"pill you sm",style:{marginLeft:8},children:"No values for stories yet"}),t.jsxs("div",{className:"note",children:[e.ready?"Stories use the file at ":"Stories need their own values, in a file at ",t.jsx("span",{className:"mono",children:e.storyFile})]}),!e.ready&&e.inFolder&&t.jsx("button",{className:"linkbtn",style:{marginTop:4},disabled:s.isPending,onClick:()=>s.mutate({path:`${uo}/use-mine`,body:e,done:"Copied. Change any real values in it to test values"}),children:"Start from the one in my folder"})]})}function VL(){const e=$e({queryKey:["project-files"],queryFn:()=>Se(uo)}),n=pe(),[s,r]=C.useState(""),[i,o]=C.useState(""),l=e.data;if(!l)return null;const u=l.repos.length>1,d={repo:i||(u?"":l.repos[0]),path:s},p=f=>n.mutate({path:`${uo}/${f}`,body:d,done:`Added ${s}`},{onSuccess:()=>r("")});return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Files agents may not touch"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:["For engineers. ",t.jsx("b",{children:"Local files"})," are files git does not carry, like .env.dev. squad-kit puts them in each story's copy for the project's own tests and app, and no agent can read them. A test could still read and send what is in them, so give stories local test values, never real ones. ",t.jsx("b",{children:"Locked files"})," are in git: agents can read them and never change them."]}),l.local.map(f=>t.jsx(HL,{f,many:u},`${f.repo}/${f.path}`)),l.locked.map(f=>t.jsx(Hw,{f,many:u,children:t.jsx("span",{className:"pill sm",style:{marginLeft:8},children:"Locked"})},`${f.repo}/${f.path}`)),t.jsxs("div",{className:"part-file-add",children:[u&&t.jsxs("select",{className:"input mono","aria-label":"Repo",value:i,onChange:f=>o(f.target.value),children:[t.jsx("option",{value:"",children:"Pick a repo"}),l.repos.map(f=>t.jsx("option",{value:f,children:f},f))]}),t.jsx("input",{className:"input mono","aria-label":"File",value:s,placeholder:".env.dev",onChange:f=>r(f.target.value)}),t.jsx("button",{className:"btn sm",disabled:!s.trim()||n.isPending,onClick:()=>p("local"),children:"Add as local"}),t.jsx("button",{className:"btn sm",disabled:!s.trim()||n.isPending,onClick:()=>p("locked"),children:"Lock it"})]}),t.jsxs("div",{className:"part-add",children:[l.docker.length>0?t.jsxs("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`${uo}/lock-docker`,done:"Locked the Docker files"}),children:["Lock ",l.docker.length===1?"the Docker file":`the ${l.docker.length} Docker files`]}):t.jsx("span",{}),t.jsx(re,{text:"squad files"})]})]})}function KL(){const e=Ke(),n=e.data?.ready?e.data.tickets.filter(Xo):[],s=Vu();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Waiting for you"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad inbox"})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page",children:e.isError&&!e.data?t.jsx(So,{what:"what waits for you",error:e.error,onRetry:()=>void e.refetch()}):n.length+s.length===0?t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(ge,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Nothing needs you right now"}),t.jsx("span",{children:"The squad is working. Questions, plans, proof and decisions land here."})]})]}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.map(r=>t.jsx(Jb,{w:r},r.id)),n.map(r=>t.jsxs("div",{className:"wcard",style:{padding:"16px 18px 16px 22px"},children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"id",children:r.id}),t.jsx(ew,{t:r}),t.jsx("span",{children:_s[r.stage]}),t.jsx("span",{children:St(r.activity[0]?.at??r.createdAt)})]}),t.jsx(D,{as:"h3",text:r.title}),t.jsx(D,{as:"p",text:Xm(r)&&r.agentQuestion?`“${r.agentQuestion.text}”`:r.waiting?.summary??(qs(r)?`Change ${si(r).id} to the spec waits for you`:bs(r)?mm(r):r.outdated?.length?hm(r):`Looks stuck: ${r.quiet?.detail??"no progress"}`)})]}),t.jsx(re,{text:!r.waiting&&qs(r)?`squad propose ${r.id} --approve`:!r.waiting&&bs(r)?`squad test-command ${r.id} --use`:dm(r)}),r.waiting?.kind==="proof"?t.jsx(Ce,{to:"/tickets/$id/proof",params:{id:r.id},className:"btn pri sm",children:au(r)}):t.jsx(Ce,{to:"/board",search:{ticket:r.id},className:"btn pri sm",children:r.waiting?au(r):qs(r)?"Check the change":"Check it"})]},r.id))]})})})]})}function YL(){const e=Ke(),[n,s]=C.useState(!1),r=e.data?.ready?e.data.tickets.filter(i=>i.kind==="bug"):[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Bugs"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:'squad bug "What happened"'}),t.jsxs("button",{className:"btn pri",onClick:()=>s(!0),children:[t.jsx(Os,{size:15})," Report a bug"]})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",children:[t.jsx("p",{className:"note",style:{marginBottom:12},children:"Each bug is a ticket linked to the release it was found in. It goes around the same loop, and the Tester adds a check so it can't come back."}),r.length===0?t.jsx("p",{className:"note",children:"No open bugs."}):t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:90},children:"ID"}),t.jsx("th",{children:"What happened"}),t.jsx("th",{style:{width:120},children:"Found in"}),t.jsx("th",{style:{width:120},children:"Stage"}),t.jsx("th",{style:{width:240},children:"Now"})]})}),t.jsx("tbody",{children:r.map(i=>t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:i.id}),t.jsx("td",{...De(i.title),children:t.jsx(Ce,{to:"/board",search:{ticket:i.id},style:{fontWeight:600},children:t.jsx(Kt,{text:i.title,dir:De(i.title).dir})})}),t.jsx("td",{children:i.foundIn??""}),t.jsx("td",{children:_s[i.stage]}),t.jsx("td",{style:{color:i.waiting?"var(--you-ink)":"var(--muted)"},...De(i.waiting?.summary??i.status),children:t.jsx(Kt,{text:i.waiting?.summary??i.status,dir:De(i.waiting?.summary??i.status).dir})})]},i.id))})]})]})}),n&&t.jsx(Ym,{onClose:()=>s(!1)})]})}const GL=[{key:"setup",label:"Set up",hint:"Installs what the project needs, e.g. npm install"},{key:"test",label:"Test",hint:"Runs the tests, e.g. npm test"},{key:"lint",label:"Lint",hint:"Checks code style, e.g. npm run lint"},{key:"build",label:"Build",hint:"Builds the project, e.g. npm run build"},{key:"start",label:"Start",hint:"Runs the app for screenshots, e.g. npm start"},{key:"url",label:"App address",hint:"Where the app opens, e.g. http://localhost:3000"},{key:"deploy",label:"After a release",hint:"Runs after a release, e.g. az pipelines run …"}];function QL(){const e=Ke(),n=e.data?.ready?e.data.meta:void 0;if(!n)return null;const s=n.repos?.length?n.repos:[{path:".",base:n.git?.base??"main",remote:n.git?.remote??"",commands:n.commands??{}}],r=!!n.repos?.length;return t.jsxs(t.Fragment,{children:[t.jsx(UL,{}),t.jsx(VL,{}),t.jsx("h2",{style:{marginTop:6},children:"How the squad checks and runs this project"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:["The Architect filled these in when it read the project. squad-kit runs Test, Lint and Build itself before anything ships.",r&&" This project has several code folders; each ticket works in one of them."]}),s.map(i=>t.jsx(ZL,{repo:i,multi:r},i.path)),t.jsx(rM,{})]})}function ZL({repo:e,multi:n}){const s=pe(),[r,i]=C.useState(null),[o,l]=C.useState(null),u=r??e.commands,d=o??{base:e.base,remote:e.remote},p=()=>{const f=n?{repos:[{path:e.path,...d,commands:u}]}:{commands:u,git:d};s.mutate({path:"/api/v1/settings",method:"PUT",body:f,done:"Settings saved"},{onSuccess:()=>{i(null),l(null)}})};return t.jsxs("div",{style:{marginBottom:24},children:[n&&t.jsxs("h3",{className:"mono",style:{fontSize:14,margin:"18px 0 2px"},children:[e.path,e.summary&&t.jsx(D,{className:"note",style:{fontFamily:"inherit",marginLeft:8},text:e.summary})]}),GL.map(f=>t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:f.label}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:u[f.key]??"",placeholder:f.hint,onChange:m=>i({...u,[f.key]:m.target.value})})]},f.key)),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Release branch"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:d.base,onChange:f=>l({...d,base:f.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Push to"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:d.remote,placeholder:"origin (empty: no push)",onChange:f=>l({...d,remote:f.target.value})})]}),t.jsx("div",{style:{marginTop:12},children:t.jsxs("button",{className:"btn pri sm",disabled:!r&&!o,onClick:p,children:["Save",n?` ${e.path}`:""]})})]})}function XL(){const e=pe(),n=$e({queryKey:["tracker"],queryFn:()=>Se("/api/v1/tracker"),refetchInterval:6e4}),[s,r]=C.useState(null),i=n.data,o=s??{organization:i?.organization??"",project:i?.project??"",token:""},l=i?.type==="azure"&&i.user;return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Azure DevOps"}),t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:"Stories and bugs come from Azure Boards. squad-kit moves them along as the squad works, opens a pull request for each finished ticket, and merges it when you release. Your token stays on this computer."}),i&&t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Status"}),t.jsx("span",{children:l?t.jsxs("span",{className:"pill ok",children:["Connected as ",i.user]}):i.type==="azure"?t.jsx("span",{className:"pill bug",children:i.error??(i.hasToken?"Not connected":"Needs a token")}):t.jsx("span",{className:"pill wait",children:"Not set up"})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Organization"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:o.organization,placeholder:"e.g. momenysr",onChange:u=>r({...o,organization:u.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Project"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:o.project,placeholder:"e.g. Mawid",onChange:u=>r({...o,project:u.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Token"}),t.jsx("input",{className:"input mono",style:{fontSize:13},type:"password",autoComplete:"off",value:o.token,placeholder:i?.hasToken?"Saved. Paste a new one to replace it":"Personal access token from Azure DevOps",onChange:u=>r({...o,token:u.target.value})})]}),t.jsxs("div",{style:{marginTop:12,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn pri sm",disabled:!s||e.isPending,onClick:()=>e.mutate({path:"/api/v1/tracker",method:"PUT",body:o,done:"Azure DevOps is connected"},{onSuccess:()=>{r(null),n.refetch()}}),children:e.isPending?"Checking…":"Save and check"}),t.jsx("span",{className:"note",children:"Token scopes: Work Items and Code (read, write and manage)."}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad config set tracker"})]})]})}function JL(){const e=pe(),n=$e({queryKey:["speech"],queryFn:()=>Se("/api/v1/speech")}),[s,r]=C.useState(""),i=n.data?.hasKey,o=n.data?.video!==!1,l=(u,d)=>e.mutate({path:"/api/v1/speech",method:"PUT",body:u,done:p=>p.unchecked?"Saved. squad-kit could not reach Munsit to check the key, so it finds out with the first note.":d},{onSuccess:()=>{r(""),n.refetch()}});return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Speech to text"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:[o?"Agents cannot listen. With a Munsit key, squad-kit writes out every voice and video note you attach, in Arabic or English, and takes pictures of the screen in videos.":"Agents cannot listen. With a Munsit key, squad-kit writes out every voice note you attach, in Arabic or English. Video notes need a Mac: on this computer they stay attached, and nobody hears them."," ","Without a key, notes stay attached but nobody hears them. Your key stays on this computer."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Status"}),t.jsx("span",{children:i?t.jsx("span",{className:"pill ok",children:"Munsit is set up"}):t.jsx("span",{className:"pill wait",children:"Not set up"})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Munsit key"}),t.jsx("input",{className:"input mono",style:{fontSize:13},type:"password",autoComplete:"off",value:s,placeholder:i?"Saved. Paste a new one to replace it":"API key from munsit.com",onChange:u=>r(u.target.value)})]}),t.jsxs("div",{style:{marginTop:12,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn pri sm",disabled:!s.trim()||e.isPending,onClick:()=>l({munsit:s},"Munsit is set up"),children:"Save"}),i&&t.jsx("button",{className:"btn sm",disabled:e.isPending,onClick:()=>l({remove:!0},"Munsit key removed"),children:"Remove"})]})]})}function eM(){const{restarting:e,restart:n}=Ik();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Board"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",disabled:e,onClick:()=>void n(),children:e?"Restarting…":"Restart the board"}),t.jsx("span",{className:"note",children:"Same link. Running work picks up where it stopped."}),t.jsx(re,{text:"squad console --restart"})]})]})}function tM(){const e=Ke(),n=pe(),s=e.data?.ready?e.data.meta:void 0;if(!s)return null;const r=s.runner??"acp",i=(o,l)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{runner:o},done:l});return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Talk to Claude"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${r==="acp"?"pri":""}`,onClick:()=>i("acp","The squad talks to Claude the usual way"),children:"The usual way"}),t.jsx("button",{className:`btn sm ${r==="direct"?"pri":""}`,onClick:()=>i("direct","The squad runs Claude Code directly"),children:"Directly"}),t.jsx("span",{className:"note",style:{marginLeft:6},children:"Leave this on The usual way. If that cannot start, a step runs Claude Code directly by itself."})]})]})}function nM(){const e=Rk(),n=pe(),s=e.data;return s?t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Tickets at once"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[Array.from({length:s.max},(r,i)=>i+1).map(r=>t.jsx("button",{className:`btn sm ${r===s.parallel?"pri":""}`,onClick:()=>n.mutate({path:"/api/v1/app/settings",method:"PUT",body:{parallel:r},done:`Up to ${r} tickets at once, across all your projects`}),children:r},r)),t.jsx("span",{className:"note",style:{marginLeft:6},children:"How many tickets the squads work on at the same time, across all your projects. They share your AI accounts."})]})]}):null}function sM({on:e}){const n=pe();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Project documents in git"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{documentsInGit:!e},done:e?"Project documents stay out of git":"Project documents go into git with each ticket"}),children:e?"On: turn it off":"Off: turn it on"}),t.jsx("span",{className:"note",children:"On: each ticket's spec, design and decisions are committed with its code, so they reach the team through the pull request. Hand over needs it on."})]})]})}function rM(){const e=pe();return t.jsx("div",{style:{margin:"4px 0 26px"},children:t.jsx("button",{className:"btn sm",onClick:()=>e.mutate({path:"/api/v1/scan",done:"The Architect is reading the project again"}),children:"Read the project again"})})}function iM(){const e=Ke(),{theme:n,toggleTheme:s,showCommands:r,toggleCommands:i}=Le(),o=pe(),[l,u]=C.useState(!1),d=e.data?.ready?e.data.meta:void 0;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"top",children:t.jsx("h1",{children:"Settings"})}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",style:{maxWidth:760},children:[t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Theme"}),t.jsx("span",{children:t.jsx("button",{className:"btn sm",onClick:s,children:n==="light"?"Switch to dark":"Switch to light"})})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Terminal commands"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn sm",onClick:i,children:r?"Hide them":"Show them"}),t.jsx("span",{className:"note",children:"Every button shows the command that does the same thing."})]})]}),t.jsx(GI,{}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Project files"}),t.jsxs("span",{className:"note",children:[t.jsx("span",{className:"mono",style:{fontSize:13},children:".squad/"})," in the project folder: specs, decisions and releases, shared with the team. Live progress, chats and sign-ins stay on this computer."]})]}),d?.engine==="live"&&t.jsx(sM,{on:d.documentsInGit!==!1}),t.jsx(eM,{}),d?.engine==="live"&&t.jsx(nM,{}),d?.engine==="live"&&t.jsx(tM,{}),d?.engine==="live"&&t.jsx(qL,{}),d?.engine==="live"&&t.jsx(XL,{}),d?.engine==="live"&&t.jsx(JL,{}),d?.engine==="live"&&t.jsx(QL,{}),d?.engine==="demo"&&t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Demo board"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsxs("button",{className:"btn sm danger",onClick:()=>u(!0),children:[t.jsx(Kr,{size:13})," Start the demo over"]}),t.jsxs("span",{className:"note",children:["The squad plays back a recorded run at ",d.speed,"x speed."]})]})]}),d&&t.jsx(kF,{}),t.jsx("h2",{style:{marginTop:26},children:"About squad-kit"}),t.jsx(Mk,{}),t.jsx(ER,{})]})}),l&&t.jsx(He,{title:"Start the demo over?",onClose:()=>u(!1),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:()=>o.mutate({path:"/api/v1/demo/reset",done:"The demo board is fresh again."},{onSuccess:()=>u(!1)}),children:[t.jsx(Kr,{size:15})," Start over"]}),t.jsx("button",{className:"btn",onClick:()=>u(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad demo"})]}),children:t.jsx("p",{children:"Every ticket, release and decision goes back to how the demo starts."})})]})}function j1(e=""){const[n,s]=C.useState(e),r=$e({queryKey:["app","folders",n],queryFn:()=>Se(`/api/v1/app/folders${n?`?path=${encodeURIComponent(n)}`:""}`)});return{at:n,setAt:s,listing:r}}function aM(e){return $e({queryKey:["app","folders","look",e?.path],queryFn:()=>Se(`/api/v1/app/folders/look?path=${encodeURIComponent(e.path)}`),enabled:!!e?.canAdd,retry:!1})}function oM(e){const n=e.split("/").filter(Boolean);return[{name:"/",path:"/"},...n.map((s,r)=>({name:s,path:`/${n.slice(0,r+1).join("/")}`}))]}function k1({at:e,go:n,listing:s,onError:r}){const[i,o]=C.useState(null),[l,u]=C.useState(!1),d=s.data,p=j=>j.replace(/[/\\][^/\\]+[/\\]?$/,"")||"/",f=d?.parent??(s.isError&&e?p(e):null),m=j=>{o(null),n(j)},x=async()=>{if(!(!d||!i?.trim()||l)){u(!0);try{const j=await at("/api/v1/app/folders","POST",{parent:d.path,name:i.trim()});m(j.path)}catch(j){r(j instanceof Error?j.message:String(j))}finally{u(!1)}}},y=d?oM(d.path):[];return t.jsxs(t.Fragment,{children:[d&&t.jsx("div",{className:"places",children:d.places.map(j=>t.jsx("button",{className:`btn sm ${j.path===d.path?"pri":""}`,onClick:()=>m(j.path),children:j.name},j.path))}),t.jsxs("div",{className:"fb",children:[t.jsxs("div",{className:"fb-bar",children:[t.jsx("button",{className:"iconbtn",disabled:!f,onClick:()=>f&&m(f),"aria-label":"Up one folder",title:"Up one folder",children:t.jsx(YN,{size:15})}),t.jsx("span",{className:"crumbs mono",children:y.map((j,k)=>t.jsxs("span",{children:[k>0&&t.jsx(Tu,{size:12}),t.jsx("button",{onClick:()=>m(j.path),children:j.name})]},j.path))})]}),t.jsxs("div",{className:"fb-list",role:"list",children:[s.isError&&t.jsx("p",{className:"note bad",children:s.error.message}),d&&d.folders.length===0&&t.jsx("p",{className:"note",children:"No folders inside."}),d?.folders.map(j=>t.jsxs("button",{role:"listitem",className:"fb-row",onClick:()=>m(j.path),children:[j.kind==="project"?t.jsx(QN,{size:16}):j.kind==="repo"?t.jsx(ZN,{size:16}):t.jsx(XN,{size:16}),t.jsx("span",{className:"nm",children:j.name}),j.kind==="project"&&t.jsx("span",{className:"pill ok sm",children:"squad-kit project"}),j.kind==="repo"&&t.jsx("span",{className:"pill sm",children:"code"})]},j.path))]}),t.jsx("div",{className:"fb-new",children:i===null?t.jsxs("button",{className:"btn sm",disabled:!d,onClick:()=>o(""),children:[t.jsx(Xp,{size:14})," New folder here"]}):t.jsxs(t.Fragment,{children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(i),placeholder:"Name of the new folder",value:i,onChange:j=>o(j.target.value),onKeyDown:j=>j.key==="Enter"&&void x()}),t.jsx("button",{className:"btn sm pri",disabled:!i.trim()||l,onClick:()=>void x(),children:"Make it"}),t.jsx("button",{className:"btn sm",onClick:()=>o(null),children:"Cancel"})]})})]})]})}const ku={all:"All agents",analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"},Vw={checks:"With the checks",merge:"Before merge",release:"Before release"},lM={checks:"with the checks",merge:"before merge",release:"before release"},v1="It applies from the next step of every story.",Kw="On this computer it runs without the guard, as your project's own checks do.",G2={try:"Try first",on:"On",off:"Off"},cM=/\b(commit|push|pull request|merge request|gh pr)\b/i;function uM(e){return e.kind==="rule"?`Rule, for ${e.agents?.includes("all")?"all agents":`the ${e.agents?.map(n=>ku[n]??n).join(" and ")}`}`:e.kind==="checklist"?`Checklist, for the ${ku[e.agent??"reviewer"]}`:`Gate, ${lM[e.when??"checks"]}${e.on_fail==="warn"?", warn only":""}`}function dM(e){const n=`the ${e.kind} "${as(e.name)}"`;return e.did==="added"?`added ${n}${e.from?`, from the folder ${as(e.from)}`:""}`:e.did==="removed"?`removed ${n}`:e.did==="tried"?`tried ${n} again`:e.did==="off"?`turned off ${n}`:e.did==="on"?`turned on ${n}`:`set ${n} to Try first`}const Q2=8;function hM({view:e}){const[n,s]=C.useState(!1),[r,i]=C.useState(!1),o=e.additions;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hn-addhead",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:"What your team added"}),t.jsxs("p",{className:"note",children:[o.shared?"Saved with the project. Your team gets it with your next release.":"Saved on this computer. This project keeps its board out of git, so your team does not get it."," Additions can only make the squad stricter."]})]}),t.jsxs("button",{className:"btn pri hn-big",disabled:!!o.broken,onClick:()=>s(!0),children:[t.jsx(Nt,{size:16})," Add to your harness"]})]}),o.broken&&t.jsxs("div",{className:"hn-box bad",role:"alert",children:[t.jsx("b",{children:o.broken})," Until then, stories stop and ask at each check instead of going on without your team's gates."]}),!o.broken&&t.jsxs("div",{className:"hn-box",children:[t.jsx("b",{children:"Try first"})," lets a new gate or checklist run and tell you what it would have stopped, without stopping anything. Turn it on when you trust it."]}),o.items.length===0&&!o.broken&&t.jsxs("div",{className:"hn-empty",children:[t.jsx("b",{children:"Nothing added yet."}),t.jsx("p",{className:"note",children:"Your harness is fully working as it is. Add a rule, a checklist or a gate when your team needs one."}),t.jsxs("button",{className:"btn",onClick:()=>s(!0),children:[t.jsx(Nt,{size:15})," Add the first one"]})]}),o.items.length>0&&t.jsx("div",{className:"hn-card",children:o.items.map(l=>t.jsx(pM,{a:l,view:e},l.id))}),t.jsxs("p",{className:"note hn-gap",children:["squad-kit's own gates aren't on this list, because they can't be turned off. ",t.jsx(Ce,{className:"hn-link",to:"/harness",search:{},children:"See them on the line."})]}),o.log.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Who did what"}),t.jsx("ul",{className:"hn-log",children:(r?o.log:o.log.slice(0,Q2)).map((l,u)=>t.jsxs("li",{children:[t.jsx("b",{children:as(l.by)})," ",dM(l)," ",t.jsx("small",{children:St(l.at)})]},u))}),!r&&o.log.length>Q2&&t.jsxs("button",{className:"btn sm hn-gap",onClick:()=>i(!0),children:["Show all ",o.log.length]})]}),n&&t.jsx(fM,{view:e,close:()=>s(!1)})]})}function pM({a:e,view:n}){const s=pe(),{toast:r}=Le(),[i,o]=C.useState(!1),[l,u]=C.useState(!1),[d,p]=C.useState(null),f=x=>s.mutate({path:`/api/v1/harness/additions/${e.id}/state`,body:{state:x},done:x==="off"?`${e.name} is off.`:`${e.name} is ${G2[x]}. ${v1}`}),m=async()=>{u(!0),p(null);try{p(await at("/api/v1/harness/try","POST",{id:e.id}))}catch(x){r(x instanceof Error?x.message:String(x),"err")}u(!1)};return t.jsxs("article",{id:`add:${e.id}`,className:`hn-row hn-add ${e.state==="off"?"off":""}`,children:[t.jsxs("div",{className:"hn-addtop",children:[t.jsxs("div",{children:[t.jsx("h3",{dir:"auto",children:e.name}),t.jsx("small",{children:uM(e)})]}),t.jsx("div",{className:"hn-seg2",role:"group","aria-label":`${e.name}: on or off`,children:(e.kind==="rule"?["on","off"]:["try","on","off"]).map(x=>t.jsx("button",{className:x===e.state?`s-${x}`:"","aria-pressed":x===e.state,disabled:s.isPending,onClick:()=>x!==e.state&&f(x),children:G2[x]},x))})]}),e.text&&t.jsx("p",{dir:"auto",className:"hn-said",children:e.text}),e.questions&&t.jsx("ol",{dir:"auto",className:"hn-qs",children:e.questions.map(x=>t.jsx("li",{children:x},x))}),e.command&&t.jsx("code",{className:"term hn-cmd",dir:"ltr",children:e.command}),e.note&&t.jsx("p",{className:"if",children:e.note}),e.kind==="gate"&&!l&&!d&&e.tried&&t.jsx("p",{className:"if",children:e.tried.result==="passed"?`Passed in ${e.tried.seconds} seconds when tried, ${St(e.tried.at)}.`:`It fails on today's code, so it can't must-pass yet. Tried ${St(e.tried.at)}.`}),l&&t.jsx(Ji,{running:!0}),d&&t.jsx(Ji,{answer:d}),e.partGone&&t.jsx("p",{className:"if hn-warn",children:"The part it runs in is no longer in the project, so it can't run."}),e.kind==="gate"&&!n.additions.guarded&&t.jsx("p",{className:"if hn-warn",children:Kw}),e.seen&&t.jsx(Xw,{s:e.seen}),t.jsxs("p",{className:"hn-from",children:[e.from==="typed"?"Typed here":`From the folder ${as(e.from)}`,". Added by ",as(e.added_by),", ",St(e.added_at),"."]}),t.jsxs("div",{className:"hn-acts",children:[e.kind==="gate"&&!n.additions.demo&&t.jsxs("button",{className:"btn sm",disabled:l,onClick:()=>void m(),children:[t.jsx(Sn,{size:13})," Try it now"]}),i?t.jsxs("span",{className:"hn-ask",children:["Remove it? It stays on the record.",t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/harness/additions/${e.id}/remove`,done:`${e.name} is removed.`}),children:"Yes, remove"}),t.jsx("button",{className:"btn sm",onClick:()=>o(!1),children:"Keep it"})]}):t.jsx("button",{className:"btn sm",onClick:()=>o(!0),children:"Remove"})]})]})}function Ji({running:e,answer:n}){if(e)return t.jsxs("p",{className:"hn-try","aria-live":"polite",children:[t.jsx(Vr,{size:15,className:"spin"})," Running inside the guard, on a clean copy of your code"]});if(!n)return null;const{result:s,seconds:r,why:i,output:o}=n;return t.jsxs("div",{"aria-live":"polite",children:[s==="passed"&&t.jsxs("p",{className:"hn-try ok",children:[t.jsx(ge,{size:15})," Passed in ",r," seconds"]}),s==="failed"&&t.jsx("p",{className:"hn-try you",children:"It runs, but it fails on today's code. It can stay on Try first, or be warn only."}),s==="cant-run"&&t.jsxs("p",{className:"hn-try bad",children:[t.jsx(Qe,{size:15})," It can't run, so it can't be saved. ",i]}),s!=="passed"&&o&&t.jsxs("details",{className:"hn-out",children:[t.jsx("summary",{children:"What it printed"}),t.jsx("pre",{dir:"ltr",children:o})]})]})}function ea({title:e,back:n,close:s,children:r,footer:i}){return C.useEffect(()=>{const o=l=>l.key==="Escape"&&s();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),t.jsx("div",{className:"hn-veil",onMouseDown:o=>o.target===o.currentTarget&&s(),children:t.jsxs("aside",{className:"hn-sheet",role:"dialog","aria-modal":"true","aria-label":e,children:[t.jsxs("header",{children:[t.jsxs("div",{children:[n&&t.jsxs("button",{className:"hn-back",onClick:n,children:[t.jsx(rk,{size:15})," Back"]}),t.jsx("h2",{children:e})]}),t.jsx("button",{className:"iconbtn","aria-label":"Close",onClick:s,children:t.jsx(Qe,{size:18})})]}),t.jsx("div",{className:"hn-sheetbody",children:r}),i&&t.jsx("footer",{children:i})]})})}function _o({label:e,value:n,options:s,set:r}){return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:e}),t.jsx("div",{className:"hn-pick",role:"group","aria-label":e,children:s.map(([i,o])=>t.jsx("button",{type:"button",className:i===n?"on":"","aria-pressed":i===n,onClick:()=>r(i),children:o},i))})]})}const Z2={pick:"Add to your harness",rule:"Add a rule",checklist:"Add a checklist",gate:"Add a gate",folder:"Bring in from a folder"};function fM({view:e,close:n}){const[s,r]=C.useState("pick"),i={view:e,close:n,title:Z2[s],back:()=>r("pick")};if(s==="rule")return t.jsx(mM,{...i});if(s==="checklist")return t.jsx(gM,{...i});if(s==="gate")return t.jsx(yM,{...i});if(s==="folder")return t.jsx(jM,{...i});const o=[["rule",t.jsx(Eu,{size:20},"r"),"A rule","Words one agent or all agents follow."],["checklist",t.jsx(pk,{size:20},"c"),"A checklist","Questions the Reviewer or the Tester answers, one by one."],["gate",t.jsx(No,{size:20},"g"),"A gate","A command squad-kit runs itself. Must pass, or warn only."],["folder",t.jsx(nm,{size:20},"f"),"From a folder","Your team's standard. You see what it holds, and tick what comes in."]];return t.jsxs(ea,{title:Z2.pick,close:n,children:[t.jsx("p",{className:"note",children:"Anything you add makes your squad stricter. It can't turn off a locked gate."}),t.jsx("div",{className:"hn-kinds",children:o.map(([l,u,d,p])=>t.jsxs("button",{onClick:()=>r(l),children:[t.jsx("span",{children:u}),t.jsx("b",{children:d}),t.jsx("small",{children:p})]},l))})]})}function b1(e){const{toast:n}=Le(),s=pe();return{busy:s.isPending,save:r=>s.mutate({path:"/api/v1/harness/additions",body:r},{onSuccess:i=>{n(`${i.added.name} added. ${i.note??v1}`),e()}})}}function mM({view:e,close:n,back:s,title:r}){const[i,o]=C.useState(""),[l,u]=C.useState("all"),[d,p]=C.useState(""),{busy:f,save:m}=b1(n),x=e.additions.limits.ruleChars;return t.jsxs(ea,{title:r,back:s,close:n,footer:t.jsx("button",{className:"btn pri",disabled:f||!i.trim()||!d.trim()||d.length>x,onClick:()=>m({kind:"rule",name:i,agents:[l],text:d}),children:"Add the rule"}),children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-n",children:"Name"}),t.jsx("input",{id:"hn-n",className:"input",dir:xe(i),value:i,onChange:y=>o(y.target.value)})]}),t.jsx(_o,{label:"Who follows it",value:l,set:u,options:Object.entries(ku)}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-t",children:"The rule"}),t.jsx("textarea",{id:"hn-t",className:"textarea",dir:xe(d),value:d,onChange:y=>p(y.target.value)}),t.jsxs("small",{className:`hn-n ${d.length>x?"over":""}`,children:[d.length," of ",x," characters"]})]}),cM.test(d)&&t.jsx("p",{className:"hn-box you",children:"This rule mentions a commit, a push or a pull request. squad-kit does those itself, so agents are told to leave that part out."}),t.jsx("p",{className:"note",children:"Rules are sent after squad-kit's own words, and can only add care. squad-kit's process comes first."})]})}function gM({view:e,close:n,back:s,title:r}){const[i,o]=C.useState(""),[l,u]=C.useState("reviewer"),[d,p]=C.useState(""),{busy:f,save:m}=b1(n),x=d.split(`
667
+ `).map(j=>j.trim()).filter(Boolean),y=e.additions.limits.questions;return t.jsxs(ea,{title:r,back:s,close:n,footer:t.jsx("button",{className:"btn pri",disabled:f||!i.trim()||!x.length||x.length>y,onClick:()=>m({kind:"checklist",name:i,agent:l,questions:x}),children:"Add the checklist"}),children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-n",children:"Name"}),t.jsx("input",{id:"hn-n",className:"input",dir:xe(i),value:i,onChange:j=>o(j.target.value)})]}),t.jsx(_o,{label:"Who answers",value:l,set:u,options:[["reviewer","Reviewer"],["tester","Tester"]]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-q",children:"Questions, one on each line"}),t.jsx("textarea",{id:"hn-q",className:"textarea",dir:xe(d),value:d,onChange:j=>p(j.target.value)}),t.jsxs("small",{className:`hn-n ${x.length>y?"over":""}`,children:[x.length," of ",y," questions"]})]}),t.jsxs("div",{className:"hn-box",children:[t.jsx("b",{children:"If an answer is no."})," It starts on Try first: the answers show on the story and a no stops nothing. On: ",l==="reviewer"?"a no counts as a review finding, and the Builder fixes it.":'a no goes the same way as a "done when" not shown.']})]})}function xM({view:e,part:n,set:s}){return e.additions.parts.length?t.jsx(_o,{label:"Which part it runs in",value:n,set:s,options:e.additions.parts.map(r=>[r.id,r.name])}):null}function yM({view:e,close:n,back:s,title:r}){const[i,o]=C.useState(""),[l,u]=C.useState(""),[d,p]=C.useState("checks"),[f,m]=C.useState("stop"),[x,y]=C.useState(""),[j,k]=C.useState(!1),[b,S]=C.useState(null),[N,$]=C.useState(""),{busy:A,save:R}=b1(n),E=e.additions.parts.length>0,M=async()=>{k(!0),S(null),$("");try{S(await at("/api/v1/harness/try","POST",{command:l,...x?{part:x}:{}}))}catch(W){$(W instanceof Error?W.message:String(W))}k(!1)},F=i.trim()&&b&&b.result!=="cant-run";return t.jsxs(ea,{title:r,back:s,close:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:A||!F,onClick:()=>R({kind:"gate",name:i,command:l,when:d,on_fail:f,...x?{part:x}:{}}),children:"Add the gate"}),t.jsx("span",{className:"note",children:"It starts on Try first."})]}),children:[t.jsx("p",{className:"note",children:"A command squad-kit runs itself, inside the guard. No agent can change it or talk its way past it."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-n",children:"Name"}),t.jsx("input",{id:"hn-n",className:"input",dir:xe(i),value:i,onChange:W=>o(W.target.value)})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-c",children:"Command"}),t.jsx("input",{id:"hn-c",className:"input mono",dir:"ltr",value:l,onChange:W=>{u(W.target.value),S(null)}}),t.jsx("small",{className:"hn-n",children:"No passwords in the command: this file is shared with your team."})]}),t.jsx(_o,{label:"When it runs",value:d,set:p,options:Object.entries(Vw)}),t.jsx(_o,{label:"If it fails",value:f,set:m,options:[["stop","Must pass"],["warn","Warn only"]]}),t.jsx(xM,{view:e,part:x,set:W=>{y(W),S(null)}}),t.jsxs("div",{className:"hn-box",children:[t.jsxs("div",{className:"hn-tryrow",children:[t.jsx("span",{children:"Try it once first, on your latest code, so a broken gate can't stop every story."}),t.jsxs("button",{className:"btn sm",disabled:j||!l.trim()||E&&!x,onClick:()=>void M(),children:[t.jsx(Sn,{size:13})," Try it now"]})]}),j&&t.jsx(Ji,{running:!0}),b&&t.jsx(Ji,{answer:b}),N&&t.jsx("p",{className:"hn-try bad",role:"alert",children:N})]}),!e.additions.guarded&&t.jsx("p",{className:"note hn-warn",children:Kw})]})}function jM({view:e,close:n,back:s,title:r}){const{at:i,setAt:o,listing:l}=j1(),{toast:u}=Le(),[d,p]=C.useState(null),[f,m]=C.useState(""),[x,y]=C.useState(!1),[j,k]=C.useState({}),b=pe(),S=(U,_)=>U??{on:!1,agent:_==="checklist"?"reviewer":"all",when:"checks",part:""},N=(U,_,G)=>k(le=>({...le,[U]:{...S(le[U],_),...G}})),$=async()=>{y(!0),m("");try{p(await at("/api/v1/harness/folder","POST",{path:l.data?.path??i})),k({})}catch(U){m(U instanceof Error?U.message:String(U))}y(!1)},A=async U=>{const _=S(j[U.key],U.kind);N(U.key,U.kind,{running:!0,answer:void 0,problem:""});try{const G=await at("/api/v1/harness/try","POST",{command:U.command,..._.part?{part:_.part}:{}});N(U.key,U.kind,{running:!1,answer:G,on:G.result!=="cant-run"})}catch(G){N(U.key,U.kind,{running:!1,problem:G instanceof Error?G.message:String(G)})}};if(!d)return t.jsxs(ea,{title:r,back:s,close:n,footer:t.jsxs("button",{className:"btn pri",disabled:x||!l.data,onClick:()=>void $(),children:[t.jsx(nm,{size:15})," Look in this folder"]}),children:[t.jsx("p",{className:"note",children:"Bring in your team's standard. squad-kit shows what it finds, and nothing changes until you add it. Nothing in the folder runs while it looks."}),t.jsx(k1,{at:i,go:o,listing:l,onError:m}),f&&t.jsx("p",{className:"hn-try bad",role:"alert",children:f})]});const R=d.finds.filter(U=>!U.out&&!U.already),E=R.filter(U=>U.kind!=="gate"),M=R.filter(U=>U.kind==="gate"),F=d.finds.filter(U=>U.already&&!U.out),W=d.finds.filter(U=>U.out),I=R.filter(U=>j[U.key]?.on),q=()=>b.mutate({path:"/api/v1/harness/folder/add",body:{path:d.path,picks:I.map(U=>{const _=j[U.key];return{key:U.key,agent:_.agent,when:_.when,..._.part?{part:_.part}:{}}})}},{onSuccess:U=>{u(`${U.added.length} added from ${d.name}. ${v1}${U.left.length?` Not added: ${U.left.map(_=>`${_.name} (${_.why})`).join(", ")}`:""}`,U.left.length?"err":void 0),n()}}),L=U=>{const _=S(j[U.key],U.kind),G=U.kind==="gate",le=!G||_.answer&&_.answer.result!=="cant-run";return t.jsxs("div",{className:"hn-find",children:[t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:_.on,disabled:!le,onChange:V=>N(U.key,U.kind,{on:V.target.checked})}),t.jsxs("span",{children:[t.jsx("b",{dir:"auto",children:U.name}),t.jsxs("small",{dir:"auto",children:[U.kind==="checklist"?`${U.questions?.length} questions`:U.kind==="rule"?"Rule":"Gate",", from ",U.source]})]})]}),U.text&&t.jsx("p",{dir:"auto",className:"hn-said",children:U.text}),U.questions&&t.jsx("ol",{dir:"auto",className:"hn-qs",children:U.questions.map(V=>t.jsx("li",{children:V},V))}),U.command&&t.jsx("code",{className:"term hn-cmd",dir:"ltr",children:U.command}),U.kind==="rule"&&t.jsx("select",{className:"select","aria-label":"Who follows it",value:_.agent,onChange:V=>N(U.key,U.kind,{agent:V.target.value}),children:Object.entries(ku).map(([V,Y])=>t.jsx("option",{value:V,children:Y},V))}),U.kind==="checklist"&&t.jsxs("select",{className:"select","aria-label":"Who answers",value:_.agent,onChange:V=>N(U.key,U.kind,{agent:V.target.value}),children:[t.jsx("option",{value:"reviewer",children:"Reviewer"}),t.jsx("option",{value:"tester",children:"Tester"})]}),G&&t.jsxs(t.Fragment,{children:[t.jsx("select",{className:"select","aria-label":"When it runs",value:_.when,onChange:V=>N(U.key,U.kind,{when:V.target.value}),children:Object.entries(Vw).map(([V,Y])=>t.jsx("option",{value:V,children:Y},V))}),e.additions.parts.length>0&&t.jsxs("select",{className:"select","aria-label":"Which part it runs in",value:_.part,onChange:V=>N(U.key,U.kind,{part:V.target.value,answer:void 0,on:!1}),children:[t.jsx("option",{value:"",children:"Which part?"}),e.additions.parts.map(V=>t.jsx("option",{value:V.id,children:V.name},V.id))]}),t.jsxs("div",{className:"hn-tryrow",children:[t.jsx("span",{className:"note",children:"Each command needs its own try before it can be ticked."}),t.jsxs("button",{className:"btn sm",disabled:_.running||e.additions.parts.length>0&&!_.part,onClick:()=>void A(U),children:[t.jsx(Sn,{size:13})," Try it now"]})]}),_.running&&t.jsx(Ji,{running:!0}),_.answer&&t.jsx(Ji,{answer:_.answer}),_.problem&&t.jsx("p",{className:"hn-try bad",role:"alert",children:_.problem})]})]},U.key)};return t.jsxs(ea,{title:r,back:()=>p(null),close:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!I.length||b.isPending,onClick:q,children:["Add ",I.length," to your harness"]}),t.jsx("span",{className:"note",children:"You can turn each one off later."})]}),children:[t.jsxs("p",{className:"note",dir:"auto",children:["What ",d.name," holds. ",d.left>0?`Left out: ${d.left} too big, not text, keys or links leading out.`:""," ",d.more?"It holds more files than squad-kit looks at.":""]}),!d.finds.length&&t.jsxs("div",{className:"hn-empty",children:[t.jsx("b",{children:"Nothing to bring in here."}),t.jsx("p",{className:"note",children:"squad-kit looks for rule files, checkbox lists, a scripts/check and package scripts."})]}),E.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Rules and checklists"}),E.map(L)]}),M.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Commands"}),M.map(L)]}),F.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Already added"}),F.map(U=>t.jsxs("div",{className:"hn-find out",children:[t.jsx("b",{dir:"auto",children:U.name}),t.jsx("small",{children:"Already added"})]},U.key))]}),W.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"squad-kit already does these"}),t.jsx("p",{className:"note",children:"Adding them would make two processes fight, so they stay out."}),W.map(U=>t.jsxs("div",{className:"hn-find out",children:[t.jsx("b",{dir:"auto",children:U.name}),t.jsx("small",{children:U.out})]},U.key))]})]})}const kM=[["line","The line"],["compare","Compare tracks"],["limits","Limits"],["safety","Safety"],["agents","Agents"],["additions","Your additions"]],vM=[["all","All"],["you","You decide"],["stopped","Stopped something"],["needs","Needs you"],["team","Added by your team"]],Yw="Nothing matches that. Try another word, or clear the search.";function bM(){const e=ei({from:"/harness"}),n=Gt(),s=e.tab??"line",r=Ke(),i=r.data?.ready?r.data.meta.quality:void 0,o=$e({queryKey:["harness",i],queryFn:()=>Se("/api/v1/harness"),refetchInterval:15e3}).data,[l,u]=C.useState("full"),[d,p]=C.useState("checks"),[f,m]=C.useState("all"),[x,y]=C.useState(""),[j,k]=C.useState(""),b=E=>void n({to:"/harness",search:E==="line"?{}:{tab:E},replace:!0}),S=E=>{m(E),y("")},N=E=>{p(E),S("all"),k(""),matchMedia("(max-width: 760px)").matches&&requestAnimationFrame(()=>document.querySelector(".hn-body")?.scrollIntoView())},$=o?.tiles.needs??[],A=!!o;C.useEffect(()=>{const E=()=>{const M=decodeURIComponent(location.hash.slice(1)),F=o?.stages.find(W=>W.gates.some(I=>I.id===M));!F&&!o?.alwaysOn.some(W=>W.id===M)||(F&&p(F.id),S("all"),k(M),s!=="line"&&b("line"),setTimeout(()=>document.getElementById(M)?.scrollIntoView({block:"center"}),60))};return E(),addEventListener("hashchange",E),()=>removeEventListener("hashchange",E)},[A]);const R=o&&t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"ok",children:o.tiles.working})," gates working, ",t.jsx("b",{children:o.tiles.stopped})," stopped something this week, ",t.jsx("b",{className:"you",children:$.length})," needs you"]});return t.jsxs("div",{className:"scroll",children:[s==="line"?t.jsxs("header",{className:"hn-hero",children:[t.jsxs("div",{className:"hn-head",children:[t.jsxs("div",{children:[t.jsx("h1",{children:"Your harness"}),t.jsx("p",{children:"Every gate, rule and limit, exactly as the engine runs them. They are locked, so nothing can weaken them."})]}),t.jsx("div",{className:"hn-seg",role:"group","aria-label":"Track",children:o?.tracks.map(E=>t.jsx("button",{className:E.id===l?"on":"","aria-pressed":E.id===l,onClick:()=>u(E.id),children:E.name},E.id))})]}),o&&t.jsxs("div",{className:"hn-count",children:[t.jsxs("button",{onClick:()=>S("all"),children:[t.jsx("b",{className:"ok",children:o.tiles.working}),"gates working"]}),t.jsxs("button",{onClick:()=>S("stopped"),children:[t.jsx("b",{children:o.tiles.stopped}),"stopped something this week"]}),t.jsxs("button",{className:"you",onClick:()=>{const E=$.length===1?$[0]:null;E?E.proof?n({to:"/tickets/$id/proof",params:{id:E.id}}):n({to:"/board",search:{ticket:E.id}}):S("needs")},children:[t.jsx("b",{children:$.length}),"needs you now"]})]}),o&&t.jsx(wM,{stages:o.stages,track:l,on:f==="all"&&!x.trim()?d:"",pick:N})]}):t.jsxs("header",{className:"hn-hero slim",children:[t.jsx("h1",{children:"Your harness"}),t.jsx("p",{children:R})]}),t.jsx("nav",{className:"hn-tabs","aria-label":"Harness",children:kM.map(([E,M])=>t.jsx("button",{className:E===s?"on":"","aria-current":E===s?"page":void 0,onClick:()=>b(E),children:M},E))}),t.jsxs("div",{className:"hn-body",children:[o&&s==="line"&&t.jsx(NM,{view:o,stageId:d,track:l,chip:f,setChip:m,q:x,setQ:y,spot:j}),o&&s==="compare"&&t.jsx(CM,{view:o}),o&&s==="limits"&&t.jsx(TM,{view:o}),o&&s==="safety"&&t.jsx(EM,{view:o}),o&&s==="agents"&&t.jsx(PM,{view:o}),o&&s==="additions"&&t.jsx(hM,{view:o})]})]})}function wM({stages:e,track:n,on:s,pick:r}){const i=C.useRef(null);return C.useEffect(()=>{const o=i.current?.querySelector(".on");o&&(i.current.scrollLeft=o.offsetLeft-i.current.clientWidth/2)},[s]),t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hn-wrap",ref:i,children:t.jsx("div",{className:"hn-line",children:e.map((o,l)=>t.jsxs("button",{className:`hn-stop ${o.on[n].kind} ${o.id===s?"on":""}`,"aria-pressed":o.id===s,onClick:()=>r(o.id),children:[t.jsxs("i",{children:[l+1,!!o.stopped&&t.jsx("u",{"aria-label":`Stopped ${o.stopped} this week`,children:o.stopped})]}),t.jsx("b",{children:o.name}),t.jsx("small",{children:o.on[n].sub})]},o.id))})}),t.jsxs("div",{className:"hn-legend",children:[t.jsx("span",{children:"Green: squad-kit runs it, locked"}),t.jsx("span",{children:"Amber: you decide"}),t.jsx("span",{children:"Dashed: happens on its own on this track"}),t.jsx("span",{children:"Red number: stopped something this week"})]})]})}function Gw(){const{engineers:e,toggleEngineers:n}=Le();return t.jsx(Qw,{on:e,flip:n,name:"For engineers"})}function Qw({on:e,flip:n,name:s}){return t.jsxs("button",{className:"hn-sw","aria-pressed":e,onClick:n,children:[t.jsx("span",{className:`tog ${e?"on":""}`}),s]})}function Zw({s:e}){return t.jsx(Ce,{to:"/board",search:{ticket:e.id},title:e.title,children:e.id})}function Xw({s:e}){const n=e.passed!==void 0,s=(e.passed??0)+(e.stopped??0);return t.jsxs("div",{className:"hn-res",children:[n&&s>0&&t.jsx("div",{className:"bar",children:t.jsx("i",{style:{width:`${(e.passed??0)/s*100}%`}})}),n&&s>0&&t.jsxs("div",{children:[t.jsx("b",{children:e.passed})," passed, ",t.jsx("b",{children:e.stopped})," stopped",e.week?`, ${e.week} this week`:""]}),!n&&!!e.stopped&&t.jsxs("div",{children:["Stopped ",t.jsx("b",{children:e.stopped}),e.stopped===1?" story":" stories",e.week?`, ${e.week} this week`:""]}),e.last&&t.jsxs("div",{children:["Last stopped ",t.jsx(Zw,{s:e.last}),", ",St(e.last.at)]}),e.did&&t.jsx("div",{children:e.did})]})}function X2({r:e,track:n,view:s,tag:r,spot:i}){const{engineers:o}=Le(),[l,u]=C.useState(!1),d=o||l,p=e.skip?.includes(n),f=e.skip?.map(m=>s.tracks.find(x=>x.id===m)?.name).join(" and ");return t.jsxs("article",{id:e.id,className:`hn-row ${p?"off":""} ${i?"spot":""}`,children:[t.jsxs("div",{className:"hn-top",children:[t.jsxs("div",{children:[t.jsxs("h3",{dir:e.team?"auto":void 0,children:[e.name,e.you&&t.jsx("em",{children:"You decide"}),e.team&&t.jsxs("small",{className:"hn-team",children:["Added by your team",e.team.state==="try"?", on Try first":""]}),r&&t.jsx("small",{children:r}),t.jsx("a",{href:`#${e.id}`,"aria-label":`A link to ${e.name}`,children:"#"})]}),t.jsxs("p",{dir:e.team?"auto":void 0,children:[e.note?.[n]?`${e.note[n]} `:"",e.what]}),e.fail&&t.jsxs("p",{className:"if",children:[t.jsx("b",{children:"If it fails:"})," ",e.fail]}),e.then&&t.jsx("p",{className:"if",children:e.then}),f&&t.jsxs("p",{className:"if",children:["Skipped on ",f,"."]})]}),e.seen&&t.jsx(Xw,{s:e.seen})]}),e.needs?.map(m=>t.jsxs("div",{className:"hn-need",children:[t.jsxs("span",{children:[t.jsx("b",{children:m.id})," ",m.summary]}),m.proof?t.jsx(Ce,{className:"btn pri sm",to:"/tickets/$id/proof",params:{id:m.id},children:"Open the story"}):t.jsx(Ce,{className:"btn pri sm",to:"/board",search:{ticket:m.id},children:"Open the story"})]},m.id)),t.jsx("button",{className:"hn-more","aria-expanded":d,onClick:()=>u(!l),children:d?"Hide the details":"Details"}),d&&t.jsx("dl",{children:e.d?.map(([m,x])=>t.jsxs(C.Fragment,{children:[t.jsx("dt",{children:m}),t.jsx("dd",{className:"mono",children:x})]},m))})]})}function NM({view:e,stageId:n,track:s,chip:r,setChip:i,q:o,setQ:l,spot:u}){const d=o.trim().toLowerCase(),p=!!d||r!=="all",f=(N,$="")=>d&&!`${N.name} ${N.what} ${N.fail??""} ${N.then??""} ${$} ${N.d?.flat().join(" ")}`.toLowerCase().includes(d)?!1:r==="you"?!!N.you:r==="team"?!!N.team:r==="stopped"?!!N.seen?.week:r!=="needs"||!!N.needs?.length,m=e.stages.find(N=>N.id===n),x=e.stages.filter(N=>p||N===m).flatMap(N=>N.gates.filter($=>f($,N.name)).map($=>({g:$,s:N}))),y=e.alwaysOn.filter(N=>f(N)),{days:j,weekDays:k,stories:b}=e.range,S=d?`${x.length+y.length} found`:r==="all"?m.name:{you:"You decide",stopped:"Stopped something this week",needs:"Needs you now",team:"Added by your team"}[r];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hn-tools",children:[t.jsxs("label",{children:["Search every gate and rule",t.jsx("input",{className:"input",dir:xe(o),value:o,placeholder:"Try tests, Docker, picture, refused",onChange:N=>l(N.target.value)})]}),t.jsx("div",{className:"hn-chips",role:"group","aria-label":"Show",children:vM.map(([N,$])=>t.jsx("button",{className:N===r?"on":"","aria-pressed":N===r,onClick:()=>i(N),children:$},N))}),t.jsx(Gw,{})]}),t.jsx("p",{className:"note hn-range",children:b?`Counted from this project's ${b} ${b===1?"story":"stories"} on this computer, last ${j} days. This week: the last ${k} days. No record, no number.`:`No stories on this computer in the last ${j} days, so no numbers yet.`}),t.jsx("h2",{className:"hn-title hn-gap",children:S}),t.jsx("p",{className:"note hn-lead",children:p?"From every stage of the line.":m.about}),!x.length&&!y.length&&t.jsx("div",{className:"hn-none",children:Yw}),x.length>0&&t.jsx("div",{className:"hn-card",children:x.map(({g:N,s:$})=>t.jsx(X2,{r:N,track:s,view:e,tag:p?$.name:void 0,spot:u===N.id},N.id))}),y.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"hn-title hn-gap",children:"Working in every step"}),t.jsx("p",{className:"note hn-lead",children:"These belong to no stage. They watch the whole line, on every track."}),t.jsx("div",{className:"hn-card",children:y.map(N=>t.jsx(X2,{r:N,track:s,view:e,spot:u===N.id},N.id))})]})]})}const SM={You:"you",Runs:"runs","By itself":"self","Not used":"none"};function CM({view:e}){const[n,s]=C.useState(!1),r=i=>new Set(e.tracks.map(o=>JSON.stringify(i.cells?.[o.id]))).size>1;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hn-tools",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:"What each track does for you"}),t.jsx("p",{className:"note",children:"The quality gates run on every track. The tracks differ only in how much you are asked."})]}),t.jsx(Qw,{on:n,flip:()=>s(!n),name:"Only what differs"})]}),t.jsxs("p",{className:"note hn-lead",children:[t.jsx("b",{children:"Runs"}),": squad-kit does it, locked. ",t.jsx("b",{children:"You"}),": it waits for you. ",t.jsx("b",{children:"By itself"}),": decided for you, and logged. ",t.jsx("b",{children:"Not used"}),": not part of this track."]}),t.jsxs("div",{className:"hn-card hn-cmp",role:"table","aria-label":"Gates on each track",children:[t.jsxs("div",{className:"hn-cr head",role:"row",children:[t.jsx("span",{role:"columnheader",children:"Gate"}),e.tracks.map(i=>t.jsx("span",{role:"columnheader",children:i.name},i.id))]}),e.stages.map(i=>{const o=i.gates.filter(l=>!n||r(l));return o.length?t.jsxs(C.Fragment,{children:[t.jsx("div",{className:"hn-cs",children:i.name}),o.map(l=>t.jsxs("div",{className:"hn-cr",role:"row",children:[t.jsxs("span",{role:"rowheader",dir:l.team?"auto":void 0,children:[l.name,l.team&&t.jsx("small",{className:"hn-team",children:"Added by your team"})]}),e.tracks.map(u=>t.jsxs("span",{role:"cell",className:SM[l.cells?.[u.id].word??""],"data-t":u.name,children:[l.cells?.[u.id].word,l.cells?.[u.id].note&&t.jsx("small",{children:l.cells[u.id].note})]},u.id))]},l.id))]},i.id):null})]})]})}const $M=[["tries","Tries and rounds"],["pictures","Pictures and proof"],["asks","Asks and refusals"],["time","Time limits"],["sizes","Sizes and places"]];function TM({view:e}){const{engineers:n}=Le(),[s,r]=C.useState(""),[i,o]=C.useState(!1),l=s.trim().toLowerCase(),u=e.limits.filter(d=>(!l||`${d.n} ${d.name} ${d.what} ${d.id}`.toLowerCase().includes(l))&&(!i||d.hit));return t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"hn-title",children:"Your squad can't go round in circles"}),t.jsx("p",{className:"note hn-lead",children:"Every loop has an end. When one is reached, the work is kept and you decide what happens next."}),t.jsxs("div",{className:"hn-tools",children:[t.jsxs("label",{children:["Search the limits",t.jsx("input",{className:"input",dir:xe(s),value:s,placeholder:"Try picture, Docker, rounds",onChange:d=>r(d.target.value)})]}),t.jsx("div",{className:"hn-chips",children:t.jsxs("button",{className:i?"on":"","aria-pressed":i,onClick:()=>o(!i),children:["Reached in ",e.range.days," days"]})}),t.jsx(Gw,{})]}),!u.length&&t.jsx("div",{className:"hn-none hn-gap",children:Yw}),$M.map(([d,p])=>{const f=u.filter(m=>m.group===d);return f.length>0&&t.jsxs("section",{children:[t.jsx("h3",{className:"hn-sub",children:p}),t.jsx("div",{className:"hn-ledger",children:f.map(m=>t.jsxs("div",{className:"hn-lim",children:[t.jsx("b",{children:m.n}),t.jsxs("span",{children:[t.jsx("strong",{children:m.name}),m.what,m.hit&&t.jsxs("em",{children:["Reached on ",t.jsx(Zw,{s:m.hit}),", ",St(m.hit.at)]}),n&&t.jsx("code",{className:"mono",children:m.id})]})]},m.id))})]},d)}),!l&&!i&&t.jsxs(t.Fragment,{children:[t.jsxs("h3",{className:"hn-sub",children:["The most one run can use, on ",Mf.find(d=>d.id===e.quality)?.name]}),t.jsx("p",{className:"note hn-lead",children:"Reaching one pauses the step with its work kept. Give it more doubles it."}),t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Step"}),t.jsx("th",{children:"Agent turns"}),t.jsx("th",{children:"Spend at API prices"})]})}),t.jsx("tbody",{children:e.caps.map(d=>t.jsxs("tr",{children:[t.jsx("td",{children:d.name}),t.jsx("td",{children:d.turns}),t.jsxs("td",{children:["$",d.spendUsd]})]},d.key))})]})]})]})}function so({title:e,what:n,items:s,mine:r=[],children:i}){return t.jsxs("div",{className:"hn-block",children:[t.jsxs("div",{children:[t.jsx("h3",{children:e}),t.jsx("p",{className:"note",children:n})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"pills",children:[s.map(o=>t.jsxs("span",{className:"pill wait",children:[t.jsx(mk,{size:13,"aria-label":"Locked"}),o]},o)),r.map(o=>t.jsx("span",{className:"pill you mono",children:o},o))]}),i]})]})}function EM({view:e}){const n=Ke(),s=n.data?.ready?n.data.meta:void 0,r=Zu().data,i=e.safety,o=!!(r&&r.tools.some(u=>u.available)&&r.guard?.on),l=[...r?.guard?.allowRead??[],...r?.guard?.allowWrite??[]];return t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"hn-title",children:"What your squad can never touch."}),r&&t.jsxs("div",{className:"hn-lead",children:[t.jsxs("span",{className:`pill ${o?"ok":"you"}`,children:[o?t.jsx(iu,{size:15}):t.jsx(rm,{size:15}),o?"Guard on, on this computer":"Less protected on this computer"]}),!o&&t.jsx(Bw,{})]}),t.jsx(so,{title:"Hidden from the squad",what:"The Builder, the Tester and your project's own commands can't read these. No agent can read squad-kit's keys or a local file.",items:i.hidden,mine:i.local,children:l.length>0&&t.jsxs("p",{className:"note hn-lead",children:["An engineer let your project's own commands use ",t.jsx("span",{className:"mono",children:l.join(", ")}),". See Settings."]})}),t.jsx(so,{title:"No agent can change",what:"A change goes back by itself, with a line saying so.",items:i.locked,mine:i.lockedByYou}),t.jsx(so,{title:"Where agents can go",what:"The Builder only. The others have no internet, and the Tester's pictures stay on this story's app.",items:i.sites,mine:s?.engine==="live"?[]:s?.allowedHosts??[],children:s?.engine==="live"&&t.jsx(ML,{hosts:s.allowedHosts??[]})}),t.jsx(so,{title:"Questions that never reach you",what:"They are refused and logged, and the agent gets on with it.",items:i.refused}),t.jsx(so,{title:"What agents can ask squad-kit to do",what:"There is no free command. squad-kit checks every field and does the job itself.",items:i.tools})]})}const AM={claude:"Claude Code",codex:"Codex"};function PM({view:e}){const n=Ke(),s=Rk(),r=n.data?.ready?n.data.meta:void 0,i=$e({queryKey:["agents"],queryFn:()=>Se("/api/v1/agents"),refetchInterval:2e3}).data??[],[o,l]=C.useState("builder"),[u,d]=C.useState(null),p=i.find(f=>f.role===o);return t.jsxs(t.Fragment,{children:[t.jsx(IM,{notes:e.qualityNote}),t.jsx(bF,{}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Stories at once"}),t.jsxs("span",{className:"note",children:["Up to ",s.data?.parallel??r?.parallel??2,", shared by all your projects. Change it in Settings."]})]}),t.jsx("div",{className:"hn-tiles",children:i.map(f=>t.jsxs("button",{className:`hn-tile ${f.role===o?"on":""}`,"aria-pressed":f.role===o,onClick:()=>l(f.role),children:[t.jsx(ni,{role:f.role}),t.jsx("b",{children:f.name}),t.jsx("small",{children:f.working.length?`Working on ${f.working.map(m=>m.id).join(", ")}`:w1(f.levels.find(m=>m.step==="design")?.now??f.levels[0].now)})]},f.role))}),p&&t.jsx(RM,{a:p,view:e,edit:()=>d(p)}),t.jsx(gF,{}),t.jsx("h2",{className:"hn-gap",children:"Your AI tools"}),t.jsx("p",{className:"note",style:{marginTop:2},children:"squad-kit uses the logins you already have. Nothing new to buy."}),(r?.tools??[]).map(f=>t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:t.jsx(No,{size:18})}),t.jsxs("span",{children:[t.jsx("b",{children:f.name}),t.jsx("br",{}),t.jsx("span",{className:"note",children:f.name==="Codex"?"Your ChatGPT subscription":"Your Claude subscription"})]}),t.jsx("span",{className:`pill ${f.ready?"ok":"wait"}`,children:f.ready?"Ready":"Not found"})]},f.name)),t.jsx(Bw,{}),t.jsxs("div",{className:"toolrow off",children:[t.jsx("span",{className:"logo",children:t.jsx(No,{size:18})}),t.jsxs("span",{children:[t.jsx("b",{children:"Gemini CLI, Copilot CLI, Cursor"}),t.jsx("br",{}),t.jsx("span",{className:"note",children:"Coming next"})]}),t.jsx("span",{})]}),u&&t.jsx(FM,{agent:u,onClose:()=>d(null)})]})}function RM({a:e,view:n,edit:s}){const r=$e({queryKey:["core-prompts",e.role],queryFn:()=>Se(`/api/v1/agents/${e.role}/prompts`)}),i=d=>Gk(d??"").trim(),o=[{id:"all",name:"Every step",text:i(e.instructions)},...e.stepList.map(d=>({id:d.id,name:d.name,text:i(e.steps?.[d.id])}))].filter(d=>d.text),l=n.caps.filter(d=>d.key.split(".")[0]===e.role),u=n.additions.items.filter(d=>d.kind==="rule"&&d.state==="on"&&(d.agents?.includes("all")||d.agents?.includes(e.role)));return t.jsxs("div",{className:"hn-two even",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:e.name}),t.jsxs("p",{className:"note",children:[e.job,"."]}),e.working.map(d=>t.jsxs(Ce,{className:"hn-now",to:"/board",search:{ticket:d.id},children:[t.jsx("b",{className:"mono",children:d.id})," ",d.status]},d.id)),t.jsx("h3",{className:"hn-sub",children:"What it can do"}),t.jsx("ul",{className:"hn-can",children:n.agents[e.role]?.can.map(([d,p])=>t.jsxs("li",{className:p?"":"no",children:[p?t.jsx(ge,{size:16,"aria-label":"Yes"}):t.jsx(Qe,{size:16,"aria-label":"No"}),d]},d))}),t.jsxs("h3",{className:"hn-sub",children:["Your rules for the ",e.name]}),o.map(d=>t.jsxs("p",{className:"hn-rule",children:[t.jsxs("b",{children:[d.name,"."]})," ",d.text]},d.id)),u.map(d=>t.jsxs("p",{className:"hn-rule",dir:"auto",children:[t.jsxs("b",{children:[d.name,"."]})," ",d.text," ",t.jsx("small",{className:"hn-team",children:"Added by your team"})]},d.id)),!o.length&&!u.length&&t.jsx("p",{className:"note",children:"Nothing added yet."}),t.jsxs("button",{className:"btn sm hn-edit",onClick:s,children:["Edit the ",e.name]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"hn-sub",children:"How it runs"}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"AI tool"}),t.jsx("span",{className:"note",children:AM[e.tool]})]}),e.levels.map(d=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:d.name}),t.jsx("span",{className:"note",children:w1(d.now)})]},d.step)),l.map(d=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:d.name}),t.jsxs("span",{className:"note",children:["Up to ",d.turns," turns and $",d.spendUsd," for one run."]})]},d.key)),t.jsx("h3",{className:"hn-sub",children:"What it reads before it starts"}),t.jsxs("p",{className:"note",children:["Read only, and improved with every release. Your rules are added to these words and never replace them.",r.data&&` Filled in from ${r.data.ticket.title}.`]}),t.jsx("div",{className:"hn-card hn-reads",children:e.stepList.map(d=>t.jsxs("details",{children:[t.jsxs("summary",{children:[t.jsx(mk,{size:14,"aria-label":"Locked"}),d.name]}),t.jsx("pre",{className:"coreprompt",children:r.data?.prompts.find(p=>p.step===d.id)?.prompt??(r.isLoading?"Loading…":"Not available.")})]},d.id))})]})]})}const Mf=[{id:"best",name:"Best"},{id:"balanced",name:"Balanced"},{id:"thrifty",name:"Thrifty"}];function IM({notes:e}){const n=Ke(),s=pe(),r=n.data?.ready?n.data.meta:void 0;if(!r)return null;const i=r.quality??"best";return t.jsxs("div",{className:"maprow",style:{marginTop:6},children:[t.jsx("b",{style:{paddingTop:4},children:"Quality"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[Mf.map(o=>t.jsx("button",{className:`btn sm ${o.id===i?"pri":""}`,"aria-pressed":o.id===i,onClick:()=>s.mutate({path:"/api/v1/settings",method:"PUT",body:{quality:o.id},done:`Quality is ${o.name} now. The squad uses it from its next step.`}),children:o.name},o.id)),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad config set quality ${i}`})]}),Mf.map(o=>t.jsxs("span",{className:"note",style:{fontSize:12.5,...o.id===i?{color:"var(--text)"}:{}},children:[t.jsxs("b",{children:[o.name,":"]})," ",e[o.id]]},o.id))]})]})}function FM({agent:e,onClose:n}){const s=pe(),r=A=>Gk(A??"").trim(),[i,o]=C.useState(e.tool),[l,u]=C.useState(e.model),[d,p]=C.useState(e.youRole?.model??""),[f,m]=C.useState(()=>Object.fromEntries(e.levels.map(A=>[A.step,A.team??{}]))),[x,y]=C.useState(()=>Object.fromEntries(e.levels.map(A=>[A.step,A.you??{}]))),[j,k,b]=Ne(`agent-${e.role}`,"instructions",r(e.instructions)),[S,N]=C.useState(()=>Object.fromEntries(e.stepList.map(A=>[A.id,r(e.steps?.[A.id])]))),$=async()=>{const A=(E,M)=>(E?.level??"")===(M.level??"")&&(E?.effort??"")===(M.effort??"");try{for(const E of e.levels)A(E.you,x[E.step])||await at("/api/v1/me/levels","PUT",{key:`${e.role}.${E.step}`,...x[E.step]});(e.youRole?.model??"")!==d.trim()&&await at("/api/v1/me/levels","PUT",{key:e.role,...e.youRole,model:d.trim()})}catch(E){return s.reset(),alert(E instanceof Error?E.message:String(E))}const R={};(e.teamRole?.level||e.teamRole?.effort)&&(R[e.role]={level:e.teamRole.level,effort:e.teamRole.effort});for(const[E,M]of Object.entries(f))(M.level||M.effort)&&(R[`${e.role}.${E}`]=M);s.mutate({path:`/api/v1/agents/${e.role}`,method:"PUT",body:{tool:i,model:l,instructions:j,steps:S,levels:R},done:`${e.name} saved. It uses this from its next step.`},{onSuccess:()=>{b(),n()}})};return t.jsxs(He,{title:`Edit the ${e.name}`,wide:!0,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:s.isPending,onClick:$,children:"Save"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"note mono",style:{fontSize:12},children:e.file})]}),children:[t.jsxs("p",{className:"note",style:{marginTop:0},children:[e.job,"."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"AI tool"}),t.jsxs("select",{className:"input",value:i,onChange:A=>o(A.target.value),children:[t.jsx("option",{value:"claude",children:"Claude Code"}),t.jsx("option",{value:"codex",disabled:!0,children:"Codex (coming soon)"})]})]}),t.jsx(LM,{agent:e,team:f,setTeam:m,you:x,setYou:y}),t.jsxs("details",{style:{marginTop:8},children:[t.jsx("summary",{className:"note",children:"Pin exact models (advanced)"}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"For the team"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:l,placeholder:"Empty: use the levels above",onChange:A=>u(A.target.value)})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Just for me"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:d,placeholder:"Empty: use the levels above",onChange:A=>p(A.target.value)})]}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"A pinned model wins over every level. Levels are better for the team: they work whatever AI tool each person uses."})]}),t.jsxs("div",{style:{marginTop:12},children:[t.jsx("b",{style:{display:"block",marginBottom:6},children:"House rules for every step"}),t.jsx("textarea",{className:"input",rows:4,style:{width:"100%",resize:"vertical"},dir:xe(j),value:j,placeholder:`Extra instructions the ${e.name} reads in every step, in plain words.`,onChange:A=>k(A.target.value)})]}),e.stepList.map(A=>t.jsxs("div",{className:"agentstep",children:[t.jsx("b",{children:A.name}),t.jsx("textarea",{className:"input",rows:2,style:{width:"100%",resize:"vertical"},dir:xe(S[A.id]??""),value:S[A.id]??"",placeholder:`Only for the ${A.name} step. For example: ${MM[A.id]??"keep it short"}.`,onChange:R=>N({...S,[A.id]:R.target.value})})]},A.id))]})}function w1(e){const n=e.from==="project"?"set by the team":e.from==="you"?"set by you":"squad-kit's default";return`${e.modelName||e.level} (${e.model?"pinned":e.level}${e.effort?`, ${Wc[e.effort]} effort`:""}), ${n}${e.why?`, ${e.why}`:""}`}const zM={strongest:"Strongest",balanced:"Balanced",fast:"Fast"},Wc={xhigh:"extra high",high:"high",medium:"medium",low:"low"};function J2({value:e,onChange:n,below:s,agent:r}){return t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:4,minWidth:0},children:[t.jsxs("select",{className:"input",style:{fontSize:12.5,padding:"4px 6px",width:"100%"},value:e.level??"",onChange:i=>n({...e,level:i.target.value||void 0}),"aria-label":"Level",children:[t.jsxs("option",{value:"",children:["Default",s.level?` (${s.level})`:""]}),["strongest","balanced","fast"].map(i=>t.jsxs("option",{value:i,children:[zM[i],r.modelOf[i]?` · ${r.modelOf[i]}`:""]},i))]}),r.supportsEffort&&t.jsxs("select",{className:"input",style:{fontSize:12.5,padding:"4px 6px",width:"100%"},value:e.effort??"",onChange:i=>n({...e,effort:i.target.value||void 0}),"aria-label":"Effort",children:[t.jsxs("option",{value:"",children:["Default",s.effort?` (${Wc[s.effort]} effort)`:""]}),r.efforts.map(i=>t.jsxs("option",{value:i,children:[Wc[i].charAt(0).toUpperCase(),Wc[i].slice(1)," effort"]},i))]})]})}function LM({agent:e,team:n,setTeam:s,you:r,setYou:i}){return t.jsxs("div",{style:{marginTop:12},children:[t.jsx("b",{style:{display:"block",marginBottom:2},children:"Models"}),t.jsx("p",{className:"note",style:{marginTop:0,fontSize:12.5},children:"squad-kit picks a level for each step from the Quality setting: strongest where a mistake is expensive, cheaper where the work is clear. Change it for the whole team, or just for you. After a failed try, the Builder moves up a level on its own."}),t.jsxs("div",{className:"levels",role:"table",children:[t.jsxs("div",{className:"levrow head",role:"row",children:[t.jsx("span",{children:"Step"}),t.jsx("span",{children:"For the team"}),t.jsx("span",{children:"Just for me"}),t.jsx("span",{children:"Now"})]}),e.levels.map(o=>t.jsxs("div",{className:"levrow",role:"row",children:[t.jsx("span",{children:o.name}),t.jsx(J2,{agent:e,value:n[o.step]??{},below:o.standard,onChange:l=>s({...n,[o.step]:l})}),t.jsx(J2,{agent:e,value:r[o.step]??{},below:{...o.standard,...n[o.step]??{}},onChange:l=>i({...r,[o.step]:l})}),t.jsx("span",{className:"note",style:{fontSize:12.5},children:w1(o.now)})]},o.step))]})]})}const MM={questions:"always ask who will use it",spec:'write "done when" items a clerk can check by hand',scan:"the old /legacy folder is not used",design:"prefer the existing service layer over new packages",build:"use our logger, never console.log",fix:"never turn a failing test off",review:"check every query for missing tenant filters",proof:"take screenshots in Arabic too"};function qM(e,n,s){return[...(n&&e.startsWith(n)?e.slice(n.length):e).split(/[/\\]/).filter(Boolean),s||"Your project"].join(" / ")}function ej({onClose:e}){const[n,s,r]=Ne("new-project","mode","brd"),[i,o,l]=Ne("new-project","name",""),[u,d,p]=Ne("new-project","idea",""),[f,m,x]=Ne("new-project","paste",!1),[y,j,k]=Ne("new-project","text",""),[b,S]=C.useState(null),[N,$]=C.useState(!!i.trim()),[A,R]=C.useState(null),[E,M]=C.useState(!1),[F,W]=C.useState(!1),[I,q]=C.useState(null),L=j1(),U=L.listing.data,_=A??U?.place??"",G=async B=>{const J=B?[...B][0]:void 0;if(J){q(null);try{const z=await Db(J);S(z),N||o(Cf(J.name))}catch(z){q(z.message)}}},le=n==="idea"?u.trim():f?y.trim():b,V=!!(i.trim()&&le&&_&&!F),Y=Me(i.trim()||"Your project"),te=n==="idea"?`squad projects --new ${Y} --idea ${Me(u.trim()&&u.trim().length<=60?u.trim():"<what you want to build>")}`:`squad projects --new ${Y} --brd ${Me(b?.name??"<file>")}`,P=async()=>{W(!0),q(null);try{const B={name:i.trim(),where:_,...n==="idea"?{idea:u}:f?{text:y}:{file:{name:b.name,data:b.data}}},J=await at("/api/v1/app/projects/new","POST",B);for(const z of[r,l,p,x,k])z();window.location.assign(J.url.replace(/\/board$/,J.opens))}catch(B){W(!1),q(B instanceof Error?B.message:String(B))}};return t.jsxs(He,{title:"New project",wide:!0,onClose:e,losing:n==="brd"&&b?`the file ${b.name}`:null,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:!V,onClick:()=>void P(),children:F?"Creating…":"Create my project"}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:te})]}),children:[t.jsx("p",{children:"Tell your squad what you want. It sets everything else up."}),t.jsxs("div",{className:"np",children:[t.jsxs("div",{className:"seg",role:"group","aria-label":"What you have",children:[t.jsx("button",{className:n==="brd"?"on":"","aria-pressed":n==="brd",onClick:()=>s("brd"),children:"I have a BRD"}),t.jsx("button",{className:n==="idea"?"on":"","aria-pressed":n==="idea",onClick:()=>s("idea"),children:"I have an idea"})]}),n==="idea"?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"np-idea",children:"What do you want to build?"}),t.jsx("textarea",{id:"np-idea",className:"textarea",dir:xe(u),autoFocus:!0,rows:4,value:u,onChange:B=>d(B.target.value),placeholder:"In your own words, in Arabic or English. Who will use it, and what will they do?"})]}):f?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"np-paste",children:"The BRD's text"}),t.jsx("textarea",{id:"np-paste",className:"textarea rq-pastebox",dir:xe(y),autoFocus:!0,value:y,onChange:B=>j(B.target.value),placeholder:"Paste the whole document here. Headings help the Analyst find its parts."}),t.jsxs("div",{className:"rq-hint",children:["Have the file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>m(!1),children:"Choose a file instead"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx(Bb,{file:b,onPick:B=>void G(B),onClear:()=>S(null),hint:"Word or PDF, in Arabic or English. The Analyst reads it and asks only about real gaps."}),t.jsxs("div",{className:"rq-hint",children:["No file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>m(!0),children:"Paste the text instead"})]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"np-name",children:"Project name"}),t.jsx("input",{id:"np-name",className:"input",dir:xe(i),value:i,placeholder:"Visitor log",onChange:B=>{o(B.target.value),$(!0),q(null)}})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Where it goes"}),E?t.jsxs(t.Fragment,{children:[t.jsx(k1,{at:L.at,go:B=>{q(null),L.setAt(B)},listing:L.listing,onError:q}),U?.notHere&&t.jsx("p",{className:"fb-error",children:U.notHere}),t.jsxs("div",{className:"np-pick",children:[t.jsx("button",{className:"btn sm pri",disabled:!U||!!U.notHere,onClick:()=>{R(U.path),M(!1)},children:"Put it here"}),t.jsx("button",{className:"btn sm",onClick:()=>M(!1),children:"Cancel"})]})]}):t.jsxs("div",{className:"np-where",children:[t.jsx("span",{className:"grow",dir:"auto",children:_?qM(_,U?.home,i.trim()):"…"}),t.jsx("button",{className:"btn sm",disabled:!_,onClick:()=>{L.setAt(_),M(!0)},children:"Change"})]})]}),t.jsx("p",{className:"note",children:"squad-kit makes the folder for you. Nothing leaves your computer except what your AI tool reads."}),I&&t.jsx("p",{className:"fb-error",children:I})]})]})}const Zr={en:{other:"العربية",head:"Meet your engineering squad.",sub:"Five specialists turn your idea into working software. They do the technical work. You make the decisions.",squad:[["Analyst","Understands what you need"],["Architect","Plans how to build it"],["Builder","Writes the code"],["Reviewer","Checks the work"],["Tester","Shows you the proof"]],you:"You",youDo:"Say if it looks right",go:"Get started",note:"It takes about 2 minutes to get ready.",readyHead:"Is your computer ready?",readySub:"squad-kit checks this by itself. If something is missing, you get one clear step.",git:"Git",gitOk:"It keeps every version of your work safe.",tool:"Your AI tool",toolOk:e=>`${e} is ready.`,browser:"The screenshot browser",browserOk:"squad-kit sets it up by itself the first time it is needed.",checking:"Checking your computer…",goOn:"Continue",allSet:"All set. You can change these later in Settings.",oneLeft:"One step left.",anyway:"Continue anyway",steps:{"install-git":"Git is not on this computer. Install it, then come back here.","update-git":"Git is too old for squad-kit. Update it to 2.38 or newer, then come back here.","install-tool":"Your squad needs an AI tool. Open a terminal and install Claude Code with this line, then come back here.","sign-in":e=>`${e??"Your AI tool"} is here. Sign in once and your squad can work: open a terminal, run this line, and follow what it says.`},download:"Get Git",copy:"Copy",startHead:"What do you have?",newHead:"A BRD or an idea",newBody:"Start a new project from nothing. You don't need a folder, code, or any technical knowledge.",newGo:"New project",addHead:"A project I already have",addBody:"Pick its folder. Your squad reads it first, and nothing changes until you approve.",showHead:"Just show me",showBody:"Watch a sample project being built. No AI runs, and it costs nothing.",showing:"Opening the sample project…",back:"Back"},ar:{other:"English",head:"تعرّف على فريقك الهندسي.",sub:"خمسة متخصصين يحوّلون فكرتك إلى برنامج يعمل. هم يتولون العمل التقني، وأنت تتخذ القرارات.",squad:[["المحلل","يفهم ما تحتاجه"],["المهندس","يخطط لطريقة البناء"],["المطوّر","يكتب الكود"],["المراجع","يفحص العمل"],["المختبِر","يعرض لك الدليل"]],you:"أنت",youDo:"تقرر إن كان مناسبًا",go:"لنبدأ",note:"يستغرق التجهيز نحو دقيقتين.",readyHead:"هل جهازك جاهز؟",readySub:"يتحقق squad-kit من ذلك بنفسه. وإن نقص شيء، تحصل على خطوة واحدة واضحة.",git:"Git",gitOk:"يحفظ كل نسخة من عملك بأمان.",tool:"أداة الذكاء الاصطناعي",toolOk:e=>`${e} جاهز.`,browser:"متصفح لقطات الشاشة",browserOk:"يجهّزه squad-kit بنفسه عند أول حاجة إليه.",checking:"جارٍ فحص جهازك…",goOn:"متابعة",allSet:"كل شيء جاهز. يمكنك تغيير هذا لاحقًا من الإعدادات.",oneLeft:"بقيت خطوة واحدة.",anyway:"متابعة على أي حال",steps:{"install-git":"Git غير موجود على هذا الجهاز. ثبّته ثم عد إلى هنا.","update-git":"نسخة Git قديمة بالنسبة إلى squad-kit. حدّثها إلى 2.38 أو أحدث ثم عد إلى هنا.","install-tool":"يحتاج فريقك إلى أداة ذكاء اصطناعي. افتح نافذة الأوامر وثبّت Claude Code بهذا السطر، ثم عد إلى هنا.","sign-in":e=>`${e??"أداة الذكاء الاصطناعي"} موجودة. سجّل الدخول مرة واحدة ليعمل فريقك: افتح نافذة الأوامر، وشغّل هذا السطر، واتبع ما يطلبه.`},download:"تنزيل Git",copy:"نسخ",startHead:"ماذا لديك؟",newHead:"وثيقة متطلبات أو فكرة",newBody:"ابدأ مشروعًا جديدًا من الصفر. لا تحتاج إلى مجلد أو كود أو خبرة تقنية.",newGo:"مشروع جديد",addHead:"مشروع لديّ بالفعل",addBody:"اختر مجلده. يقرؤه فريقك أولًا، ولا يتغير شيء حتى توافق.",showHead:"أرني فقط",showBody:"شاهد بناء مشروع تجريبي. بلا ذكاء اصطناعي وبلا تكلفة.",showing:"جارٍ فتح المشروع التجريبي…",back:"رجوع"}},OM=[{icon:ti,color:"#2f6fd0"},{icon:em,color:"#6a4fc2"},{icon:KN,color:"#b4590f"},{icon:tm,color:"#0e6f7a"},{icon:im,color:"var(--accent)"}];async function Jw(){const e=await at("/api/v1/app/sample","POST");window.location.assign(e.url)}function _M({step:e,onStep:n,onNew:s,onAdd:r}){const[i,o]=C.useState(fm),l=Zr[i],u=()=>{const p=i==="ar"?"en":"ar";X8(p),o(p)},d=()=>{n("ready"),at("/api/v1/app/settings","PUT",{welcomed:!0}).catch(()=>{})};return t.jsx("div",{className:"wl",dir:i==="ar"?"rtl":"ltr",lang:i,children:t.jsxs("div",{className:"wl-in",children:[t.jsxs("div",{className:"wl-top",children:[t.jsxs("div",{className:"wl-logo",dir:"ltr",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("span",{children:"squad-kit"})]}),t.jsx("button",{className:"wl-lang",onClick:u,children:l.other})]}),e==="welcome"&&t.jsx(DM,{lang:i,onGo:d}),e==="ready"&&t.jsx(UM,{lang:i,onGo:()=>n("start")}),e==="start"&&t.jsx(HM,{lang:i,onNew:s,onAdd:r,onBack:()=>n("ready")})]})})}function DM({lang:e,onGo:n}){const s=Zr[e];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"wl-main wl-main-wide",children:[t.jsx("h1",{className:"wl-big",children:s.head}),t.jsx("p",{className:"wl-sub",children:s.sub}),t.jsxs("div",{className:"wl-squad",children:[t.jsx("div",{className:"wl-wire","aria-hidden":"true"}),s.squad.map(([r,i],o)=>{const{icon:l,color:u}=OM[o];return t.jsxs("div",{className:"wl-tile",style:{"--d":`${.1+o*.35}s`},children:[t.jsx("div",{className:"wl-mark",style:{color:u},children:t.jsx(l,{size:24,"aria-hidden":"true"})}),t.jsx("b",{children:r}),t.jsx("span",{children:i})]},r)}),t.jsxs("div",{className:"wl-tile",style:{"--d":"1.95s"},children:[t.jsx("div",{className:"wl-mark wl-mark-you",children:t.jsx(am,{size:24,"aria-hidden":"true"})}),t.jsx("b",{className:"wl-you",children:s.you}),t.jsx("span",{children:s.youDo})]})]})]}),t.jsxs("div",{className:"wl-go wl-go-wide",children:[t.jsx("button",{className:"wl-cta",onClick:n,children:s.go}),t.jsx("span",{children:s.note})]})]})}function BM({text:e,copy:n}){return t.jsxs("span",{className:"wl-cmd",children:[t.jsx("span",{children:e}),t.jsx("button",{"aria-label":n,title:n,onClick:()=>void navigator.clipboard?.writeText(e).catch(()=>{}),children:t.jsx(os,{size:14})})]})}const WM={"install-tool":"npm install -g @anthropic-ai/claude-code","sign-in":"claude"};function tj({lang:e,step:n,label:s}){const r=Zr[e],i=r.steps[n],o=WM[n];return t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"wl-line",children:typeof i=="function"?i(s):i}),t.jsxs("span",{className:"wl-step",children:[o&&t.jsx(BM,{text:o,copy:r.copy}),(n==="install-git"||n==="update-git")&&t.jsx("a",{className:"wl-act",href:"https://git-scm.com/downloads",target:"_blank",rel:"noreferrer",children:r.download})]})]})}function Fp({state:e}){return e==="wait"?t.jsx("span",{className:"wl-tick wl-tick-wait",children:t.jsx(pn,{size:20,className:"spin",role:"img","aria-label":"Checking"})}):e==="needs"?t.jsx("span",{className:"wl-tick wl-tick-needs",children:t.jsx(jr,{size:16,strokeWidth:2.5,role:"img","aria-label":"Needs one step"})}):t.jsx("span",{className:"wl-tick",children:t.jsx(ge,{size:15,strokeWidth:3,role:"img","aria-label":"Ready"})})}function UM({lang:e,onGo:n}){const s=Zr[e],r=$e({queryKey:["app","ready"],queryFn:()=>Se("/api/v1/app/ready"),refetchInterval:l=>l.state.data?.git.ok&&l.state.data?.tool.ok?!1:3e3}),i=r.data,o=!!(i?.git.ok&&i?.tool.ok);return t.jsxs("div",{className:"wl-main wl-main-narrow",children:[t.jsx("h1",{children:s.readyHead}),t.jsx("p",{className:"wl-sub wl-sub-tight",children:s.readySub}),t.jsxs("div",{className:"wl-rows","aria-live":"polite",children:[t.jsxs("div",{className:"wl-row",children:[t.jsx(Fp,{state:i?i.git.ok?"ok":"needs":"wait"}),t.jsxs("div",{children:[t.jsx("b",{children:s.git}),i?i.git.step?t.jsx(tj,{lang:e,step:i.git.step}):t.jsx("span",{className:"wl-line",children:s.gitOk}):t.jsx("span",{className:"wl-line",children:s.checking})]})]}),t.jsxs("div",{className:"wl-row",children:[t.jsx(Fp,{state:i?i.tool.ok?"ok":"needs":"wait"}),t.jsxs("div",{children:[t.jsx("b",{children:s.tool}),i?i.tool.step?t.jsx(tj,{lang:e,step:i.tool.step,label:i.tool.label}):t.jsx("span",{className:"wl-line",children:s.toolOk(i.tool.label??"")}):t.jsx("span",{className:"wl-line",children:s.checking})]})]}),t.jsxs("div",{className:"wl-row",children:[t.jsx(Fp,{state:i?"ok":"wait"}),t.jsxs("div",{children:[t.jsx("b",{children:s.browser}),t.jsx("span",{className:"wl-line",children:s.browserOk})]})]})]}),t.jsxs("div",{className:"wl-go",style:{marginTop:32},children:[t.jsx("button",{className:"wl-cta",disabled:!o,onClick:n,children:s.goOn}),t.jsx("span",{children:o?s.allSet:i?s.oneLeft:s.checking}),i&&!o||r.isError?t.jsx("button",{className:"wl-quiet",onClick:n,children:s.anyway}):null]})]})}function HM({lang:e,onNew:n,onAdd:s,onBack:r}){const i=Zr[e],[o,l]=C.useState(!1),[u,d]=C.useState(""),p=async()=>{l(!0),d("");try{await Jw()}catch(f){l(!1),d(f instanceof Error?f.message:String(f))}};return t.jsxs("div",{className:"wl-main wl-main-mid",children:[t.jsx("h1",{style:{marginBottom:32},children:i.startHead}),t.jsxs("div",{className:"wl-cards",children:[t.jsxs("button",{className:"wl-card wl-card-main",onClick:n,children:[t.jsx(Eu,{size:36,strokeWidth:1.8,"aria-hidden":"true"}),t.jsx("span",{className:"wl-fill"}),t.jsx("b",{children:i.newHead}),t.jsx("span",{children:i.newBody}),t.jsx("i",{children:i.newGo})]}),t.jsxs("button",{className:"wl-card wl-card-side",onClick:s,children:[t.jsx(nm,{size:28,"aria-hidden":"true"}),t.jsx("span",{className:"wl-fill"}),t.jsx("b",{children:i.addHead}),t.jsx("span",{children:i.addBody})]}),t.jsxs("button",{className:"wl-card wl-card-side",disabled:o,onClick:()=>void p(),children:[t.jsx(Sn,{size:28,"aria-hidden":"true"}),t.jsx("span",{className:"wl-fill"}),t.jsx("b",{children:i.showHead}),t.jsx("span",{children:o?i.showing:i.showBody})]})]}),u&&t.jsx("p",{className:"wl-err",role:"alert",children:u}),t.jsx("div",{className:"wl-go",style:{marginTop:20},children:t.jsx("button",{className:"wl-quiet",onClick:r,children:i.back})})]})}function VM(){const[e,n]=C.useState(!1),[s,r]=C.useState("");return t.jsxs("button",{className:"home-empty",disabled:e,onClick:()=>{n(!0),r(""),Jw().catch(i=>{n(!1),r(i instanceof Error?i.message:String(i))})},children:[t.jsx(Sn,{size:22}),t.jsx("b",{children:"Just show me"}),t.jsx("span",{role:s?"alert":void 0,children:s||(e?Zr.en.showing:Zr.en.showBody)})]})}const nj=2e3,sj=e=>`/p/${encodeURIComponent(e)}`;function KM(e,n){const s=na(n);return e.replace(/\bsquad ([a-z-]+) (\S+)/g,(r,i,o)=>`squad ${i} ${o} --project ${s}`)}function YM(e,n){return n&&e.startsWith(n)?`~${e.slice(n.length)}`:e}function GM(){const{theme:e,toggleTheme:n}=Le(),s=$e({queryKey:["app","projects"],queryFn:()=>Se("/api/v1/app/projects"),refetchInterval:nj}),r=$e({queryKey:["app","waiting"],queryFn:()=>Se("/api/v1/app/waiting"),refetchInterval:nj}),[i,o]=C.useState(!1),[l,u]=C.useState(!1),[d,p]=C.useState(null),f=s.data?.projects??[],m=r.data?.items??[],x=Zb(),y=m.length+x.length,[j,k]=C.useState(null),b=!!s.data&&f.length===0&&!s.data?.welcomed,S=j??(b?"welcome":null);return S?t.jsxs(t.Fragment,{children:[t.jsx(_M,{step:S,onStep:k,onNew:()=>u(!0),onAdd:()=>o(!0)}),i&&t.jsx(rj,{onClose:()=>o(!1)}),l&&t.jsx(ej,{onClose:()=>u(!1)})]}):t.jsxs("div",{className:"home",children:[t.jsxs("header",{className:"home-top",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("b",{children:"squad-kit"}),t.jsx("span",{className:"grow"}),s.data&&t.jsx(QM,{s:s.data}),t.jsx(Z8,{}),t.jsx("button",{className:"theme",onClick:n,"aria-label":e==="light"?"Switch to dark":"Switch to light",children:e==="light"?t.jsx(Ko,{size:15}):t.jsx(Yo,{size:15})})]}),t.jsx(Lk,{}),t.jsx(Af,{}),t.jsx(Ef,{}),t.jsx(BI,{}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page home-page",children:[t.jsxs("section",{className:"home-projects",children:[t.jsxs("div",{className:"home-h",children:[t.jsx("h2",{children:"Projects"}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn",onClick:()=>o(!0),children:[t.jsx(Xp,{size:15})," Add project"]}),t.jsxs("button",{className:"btn pri",onClick:()=>u(!0),children:[t.jsx(Nt,{size:15})," New project"]})]}),s.isLoading?null:s.isError&&!s.data?t.jsx(So,{what:"your projects",error:s.error,onRetry:()=>void s.refetch()}):f.length===0?t.jsxs("div",{className:"home-starts",children:[t.jsxs("button",{className:"home-empty",onClick:()=>u(!0),children:[t.jsx(Oc,{size:22}),t.jsx("b",{children:"Start a new project"}),t.jsx("span",{children:"You have a BRD or an idea. You don't need a folder, code or any technical knowledge."})]}),t.jsxs("button",{className:"home-empty",onClick:()=>o(!0),children:[t.jsx(Xp,{size:22}),t.jsx("b",{children:"Add a project you already have"}),t.jsx("span",{children:"Pick its folder: one repo, or a folder with several repos."})]}),t.jsx(VM,{})]}):t.jsx("div",{className:"pcards",children:f.map(N=>t.jsx(ZM,{p:N,onRemove:()=>p(N)},N.id))}),t.jsx("div",{className:"home-cmd",children:t.jsx(re,{text:"squad projects"})})]}),t.jsxs("section",{className:"home-inbox",id:"waiting",children:[t.jsxs("div",{className:"home-h",children:[t.jsx("h2",{children:"Waiting for you"}),y>0&&t.jsx("span",{className:"badge you",children:y}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad inbox"})]}),r.isError&&!r.data?t.jsx(So,{what:"what waits for you",error:r.error,onRetry:()=>void r.refetch()}):y===0?t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(ge,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Nothing needs you right now"}),t.jsx("span",{children:f.length?"The squads are working. Questions, plans, proof and decisions from every project land here.":"Start a project to begin."})]})]}):t.jsxs("div",{className:"home-waiting",children:[x.map(N=>t.jsx(Jb,{w:N},`${N.project?.id??""}/${N.id}`)),m.map(({project:N,ticket:$})=>t.jsxs("div",{className:"wcard",children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"pill sm",children:N.name}),t.jsx("span",{className:"id",children:$.id}),t.jsx("span",{children:_s[$.stage]}),t.jsx("span",{children:St($.activity[0]?.at??$.createdAt)})]}),t.jsx(D,{as:"h3",text:$.title}),t.jsx(D,{as:"p",text:$.waiting?.summary??(qs($)?`Change ${si($).id} to the spec waits for you`:bs($)?mm($):$.outdated?.length?hm($):`Looks stuck: ${$.quiet?.detail??""}`)})]}),t.jsx(re,{text:KM(dm($),N.name)}),t.jsx("a",{className:"btn pri sm",href:$.waiting?.kind==="proof"?`${sj(N.id)}/tickets/${encodeURIComponent($.id)}/proof`:`${sj(N.id)}/board?ticket=${encodeURIComponent($.id)}`,children:$.waiting?au($):"Check it"})]},`${N.id}/${$.id}`))]})]})]})}),i&&t.jsx(rj,{onClose:()=>o(!1)}),l&&t.jsx(ej,{onClose:()=>u(!1)}),d&&t.jsx(eq,{p:d,onClose:()=>p(null)})]})}function QM({s:e}){const n=Hn(),{toast:s}=Le(),r=async i=>{try{await at("/api/v1/app/settings","PUT",{parallel:i}),n.invalidateQueries({queryKey:["app"]}),s(`Up to ${i} tickets at once, across all projects`)}catch(o){s(o instanceof Error?o.message:String(o),"err")}};return t.jsxs("label",{className:"shared",title:"Shared by all your projects, because they use the same AI accounts",children:[t.jsxs("span",{children:["Tickets at once: ",t.jsx("b",{children:e.running})," of"]}),t.jsx("select",{className:"select sm",value:e.parallel,onChange:i=>void r(Number(i.target.value)),"aria-label":"Tickets at once, across all projects",children:Array.from({length:e.max},(i,o)=>o+1).map(i=>t.jsx("option",{value:i,children:i},i))})]})}function ZM({p:e,onRemove:n}){const s=Hn(),{toast:r}=Le(),[i,o]=C.useState(!1),l=e.setup&&e.setup.status!=="done"?e.setup:null,u=e.open&&e.tickets===0?e.setup?.brd:void 0,d=async()=>{o(!0);try{await at("/api/v1/app/projects","POST",{folder:e.root}),r(`${e.name} is open`)}catch(f){r(f instanceof Error?f.message:String(f),"err")}finally{o(!1),s.invalidateQueries({queryKey:["app"]})}},p=e.open?e.setup?.ready&&!e.setup.approved?t.jsx("span",{className:"you",children:e.setup.line??"Your project overview is ready to check"}):e.setup?.line&&!e.setup.approved?t.jsx("span",{className:e.setup.status==="failed"?"bad":"you",children:e.setup.line}):l?.status==="failed"?t.jsx("span",{className:"bad",children:"The Architect could not read the project"}):u?t.jsx("span",{className:"you",children:"Your stories start from your BRD"}):l?t.jsxs("span",{className:"you",children:["Setting up: ",l.status==="running"?l.now??"the Architect reads the project":"the Architect reads the project next"]}):t.jsxs("span",{children:[e.tickets," open",e.working>0&&t.jsxs(t.Fragment,{children:[" · ",e.working," working"]}),e.waiting>0&&t.jsxs("span",{className:"you",children:[" · ",e.waiting," waiting for you"]})]}):t.jsxs("span",{className:"bad",children:["Could not open: ",e.why]});return t.jsxs("div",{className:`pcard ${e.open?"":"off"}`,children:[t.jsx("span",{className:"pm",children:e.name.charAt(0).toUpperCase()}),t.jsxs("div",{className:"grow",children:[t.jsxs("b",{children:[t.jsx(D,{text:e.name}),e.engine==="demo"&&t.jsx("small",{className:"demo",children:"Demo"})]}),t.jsx("span",{className:"mono path",title:e.root,children:e.root}),t.jsx("span",{className:"state",children:p})]}),t.jsxs("div",{className:"acts",children:[e.open?t.jsx("a",{className:"btn sm pri",href:u?e.url.replace(/\/board$/,`/requirements/${encodeURIComponent(u.id)}`):e.setup?.line&&!e.setup.approved?e.url.replace(/\/board$/,e.setup.ready?"/overview":"/setup"):e.url,children:u?"Open the BRD":e.setup?.line&&!e.setup.approved?e.setup.ready?"Check it":"See the setup":"Open board"}):t.jsx("button",{className:"btn sm",disabled:i,onClick:()=>void d(),children:"Try again"}),t.jsx("button",{className:"btn sm quiet",onClick:n,children:"Remove"})]})]})}const XM=[{kind:"empty",name:"An empty folder",text:"Start from an idea: squad-kit asks what you want to build."},{kind:"older",name:"An older squad-kit",text:"Your specs, plans and decisions stay where they are. squad-kit adds its own files beside them."},{kind:"repos",name:"Several code folders",text:"squad-kit reads each one and shows you how they fit together."}];function JM({look:e,looking:n}){return n?t.jsx("p",{className:"note","aria-live":"polite",children:"Looking at what is in this folder…"}):e?e.ask?t.jsx("div",{className:"ob-found","aria-live":"polite",children:t.jsxs("div",{className:"ob-found-c",role:"alert",children:[t.jsx("b",{children:e.title}),t.jsx("div",{children:e.found}),t.jsx("div",{className:"note",children:e.next})]})}):t.jsxs("div",{className:"ob-found","aria-live":"polite",children:[t.jsxs("div",{className:"ob-found-c",children:[t.jsx("b",{children:e.title}),t.jsx("div",{children:e.found}),t.jsx("div",{children:e.next}),t.jsx("div",{className:"note",children:e.safe})]}),t.jsxs("div",{className:"ob-also",children:[t.jsx("div",{className:"ob-k",children:"squad-kit also handles"}),XM.filter(s=>s.kind!==e.kind).slice(0,2).map(s=>t.jsxs("div",{className:"ob-also-r",children:[t.jsx("b",{children:s.name}),t.jsx("span",{children:s.text})]},s.kind))]}),t.jsx("div",{className:"note",children:e.takes})]}):null}function rj({onClose:e}){const{at:n,setAt:s,listing:r}=j1(),[i,o]=C.useState(null),[l,u]=C.useState(!1),d=r.data,p=aM(d),f=y=>{o(null),s(y)},m=p.data?.ask,x=async y=>{if(d){u(!0),o(null);try{const j=await at("/api/v1/app/projects","POST",{folder:d.path,...y?{choice:y}:{}}),k=j.setup&&!j.setup.ready&&!j.setup.approved&&j.setup.line;window.location.assign(k?j.url.replace(/\/board$/,"/setup"):j.url)}catch(j){u(!1),o(j instanceof Error?j.message:String(j))}}};return t.jsxs(He,{title:"Add a project",wide:!0,onClose:e,footer:t.jsxs(t.Fragment,{children:[m?t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:l||r.isFetching,onClick:()=>void x("above"),children:l?"Adding…":m.kind==="inside-repo"?`Add ${m.name} instead`:`Open ${m.name}`}),m.kind==="inside-project"&&t.jsx("button",{className:"btn",disabled:l||r.isFetching,onClick:()=>void x("here"),children:"Add this folder on its own"})]}):t.jsx("button",{className:"btn pri",disabled:!d?.canAdd||l||r.isFetching||p.isFetching,onClick:()=>void x(),children:l?"Adding…":d?.kind==="project"?"Open it":"Add and get to know it"}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),d&&t.jsx(re,{text:`cd ${Me(m?.root??d.path)} && squad console`})]}),children:[t.jsx("p",{className:"note",children:"Pick the project's folder: one with its code, one that holds several code folders, or a new, empty folder for a new project."}),t.jsx(k1,{at:n,go:f,listing:r,onError:o}),d&&t.jsxs("p",{className:"fb-kind",children:[t.jsx("b",{children:YM(d.path,d.home)}),!d.canAdd&&t.jsx("span",{children:"This folder can't be a project. Open a folder inside it, or make a new one here."})]}),d?.canAdd&&t.jsx(JM,{look:p.data,looking:p.isFetching}),i&&t.jsx("p",{className:"fb-error",children:i})]})}function eq({p:e,onClose:n}){const s=Hn(),{toast:r}=Le(),[i,o]=C.useState(!1),l=async()=>{o(!0);try{await at(`/api/v1/app/projects/${encodeURIComponent(e.id)}`,"DELETE"),s.invalidateQueries({queryKey:["app"]}),r(`${e.name} is out of squad-kit. Its files stay in its folder.`),n()}catch(d){o(!1),r(d instanceof Error?d.message:String(d),"err")}},u=/\s/.test(e.name)?`"${e.name}"`:e.name;return t.jsx(He,{title:`Take ${e.name} out of squad-kit?`,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn danger",disabled:i,onClick:()=>void l(),children:"Take it out"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:`squad projects --remove ${u}`})]}),children:t.jsxs("p",{children:["Its squad stops. Nothing is deleted: its files stay in ",t.jsx("span",{className:"mono",children:e.root}),". Add it again any time."]})})}function tq(){const e=ei({from:"/conversations"}),n=Gt({from:"/conversations"}),s=sa(ra),[r,i]=C.useState(""),o=Fo(r),u=Fo().data??[],d=e.ticket??u.find(y=>y.open)?.id??u[0]?.id,[p,f]=C.useState(null),m=y=>{f(null),n({search:{ticket:y}})},x=y=>{gs.show(y),n({to:"/board"})};return s?t.jsx(lq,{id:d,all:u,pick:m,doc:p,setDoc:f}):t.jsxs("div",{className:"cpage",children:[t.jsx(nq,{q:r,setQ:i}),t.jsxs("div",{className:"cpage-b",children:[t.jsx(rq,{list:o.data??[],id:d,pick:m,searching:!!r.trim()}),t.jsx("section",{className:"ccenter","aria-label":"Conversation",children:d?t.jsx(Zm,{id:d,size:"full",onOpenDoc:f,onPanel:()=>x(d)},d):t.jsxs("div",{className:"cempty",children:[t.jsx("p",{children:"No talks yet. Start one with any agent on any ticket."}),t.jsx(lw,{})]})}),p?t.jsx(Wm,{doc:p,onClose:()=>f(null)}):d?t.jsx(iq,{id:d,onOpenDoc:f}):null]})]})}function nq({q:e,setQ:n}){const s=Ke(),{theme:r,toggleTheme:i}=Le(),o=s.data?.ready?s.data.meta.project:"";return t.jsxs("header",{className:"cpage-h",children:[t.jsxs(Ce,{to:"/board",className:"btn",children:[t.jsx(rk,{size:15})," Back to the board"]}),t.jsx("h1",{children:"Conversations"}),t.jsx("span",{className:"cdim",children:o}),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"search cpage-search",children:[t.jsx(ti,{size:15}),t.jsx("input",{value:e,onChange:l=>n(l.target.value),placeholder:"Search all conversations","aria-label":"Search all conversations",dir:xe(e)})]}),t.jsx("button",{className:"iconbtn",onClick:i,"aria-label":r==="light"?"Switch to dark":"Switch to light",children:r==="light"?t.jsx(Ko,{size:16}):t.jsx(Yo,{size:16})})]})}function e3(e){return new Date(e).toDateString()===new Date().toDateString()?Wn(e):Ws(e)}function sq(e){const s=(e.match??e.last?.text??"").replace(/[*_`#>]+/g,"").replace(/\s+/g," ").trim(),r=ht(s);return{text:`${e.last?.who==="you"&&!e.match?"You: ":""}${s}`,dir:r.dir,cls:Bs(r)}}function rq({list:e,id:n,pick:s,searching:r}){const i=zu(),o=[["Waiting for you",e.filter(l=>l.open&&l.yourTurn)],["Talking now",e.filter(l=>l.open&&!l.yourTurn)],["Earlier",e.filter(l=>!l.open)]];return t.jsx("nav",{className:"clist","aria-label":"All conversations",children:t.jsxs("div",{className:"clist-s",children:[r&&!e.length&&t.jsx("p",{className:"cdim",style:{padding:"14px 18px"},children:"Nothing found."}),o.map(([l,u])=>u.length?t.jsxs("div",{children:[t.jsx("div",{className:"csec",children:l}),u.map(d=>{const p=d.id===n,f=sq(d),m=i1(d,i.seen);return t.jsxs("button",{className:`crow-i ${p?"on":""}`,onClick:()=>s(d.id),"aria-current":p,children:[t.jsx(Dn,{role:d.with,live:d.thinking}),t.jsxs("span",{className:"rt",children:[t.jsx("span",{className:"cid",children:d.id}),t.jsx("b",{children:pt[d.with]}),d.yourTurn&&t.jsx("span",{className:"cwait",children:"Your turn"})]}),t.jsx("span",{className:"rtime",children:d.thinking?"now":e3(d.at)}),t.jsx("span",{className:`rp ${d.thinking?"t-en":f.cls}`,dir:d.thinking?"ltr":f.dir,children:d.thinking?t.jsxs("span",{className:`rtyping c-${d.with}`,children:[t.jsxs("span",{className:"cdots sm",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),t.jsx("span",{className:"shim",children:"Writing"})]}):t.jsx(Kt,{text:f.text||d.title,dir:f.dir})}),m>0&&!p&&t.jsx("span",{className:"cbadge rb",children:m})]},d.id)})]},l):null)]})})}function iq({id:e,onOpenDoc:n}){const s=Qo(e).data,[r,i]=C.useState("spec");if(!s)return t.jsx("aside",{className:"cspec"});const o=[...new Set([...(s.chat?.messages??[]).flatMap(l=>l.files??[]),...s.attachments??[]])];return t.jsxs("aside",{className:"cspec","aria-label":"The ticket's spec",children:[t.jsxs("div",{className:"cstabs",role:"tablist",children:[t.jsx("button",{className:`cstab ${r==="spec"?"on":""}`,role:"tab","aria-selected":r==="spec",onClick:()=>i("spec"),children:s.chat?.open&&!s.chat.beside&&s.chat.with==="analyst"?"Spec draft":"Spec"}),t.jsxs("button",{className:`cstab ${r==="files"?"on":""}`,role:"tab","aria-selected":r==="files",onClick:()=>i("files"),children:["Files · ",o.length]}),t.jsx("button",{className:`cstab ${r==="activity"?"on":""}`,role:"tab","aria-selected":r==="activity",onClick:()=>i("activity"),children:"Activity"})]}),t.jsxs("div",{className:"csbody",children:[r==="spec"&&t.jsx(oq,{t:s}),r==="files"&&(o.length?t.jsx(Bm,{ticket:s.id,files:o,onOpen:n}):t.jsx("p",{className:"cdim",children:"No files yet. Paste or drop screenshots into the chat."})),r==="activity"&&t.jsx("div",{className:"cact-list",children:s.activity.slice(0,60).map((l,u)=>t.jsxs("div",{className:"cact-row",children:[t.jsx("span",{className:"cdim",children:e3(l.at)}),t.jsxs("span",{children:[t.jsx("b",{children:Ms[l.who]})," ",t.jsx(aq,{text:l.text})]})]},u))})]})]})}function aq({text:e}){const n=ht(e);return t.jsx("span",{dir:n.dir,className:Bs(n),children:t.jsx(Kt,{text:e,dir:n.dir})})}function Ic({text:e,fresh:n,chk:s,tone:r}){const i=ht(e);return t.jsxs("div",{className:`citem ${n?"new":""} ${r??""}`,children:[s&&t.jsx("span",{className:"cchk"}),t.jsx("span",{className:`grow ${Bs(i)}`,dir:i.dir,lang:i.dir==="rtl"?"ar":"en",children:t.jsx(Kt,{text:e,dir:i.dir})}),n&&t.jsx("span",{className:"ctag",children:"From chat"})]})}function oq({t:e}){const n=e.chat?.messages[0]?.at??"",s=e.notes??[],r=m=>!!n&&m>=n,i=e.chat?.open&&!e.chat.beside&&e.chat.with==="analyst",o=[...(e.criteria??[]).map(m=>({text:m.then,at:""})),...(e.brief?.criteria??[]).map(m=>({text:m,at:""})),...s.filter(m=>m.kind==="criterion").map(m=>({text:m.text,at:m.at}))],l=[...(e.brief?.rules??[]).map(m=>({text:m,at:""})),...s.filter(m=>m.kind==="rule").map(m=>({text:m.text,at:m.at}))],u=s.filter(m=>m.kind==="note"&&!m.to),d=(e.questions??[]).filter(m=>!m.answer).map(m=>m.text),p=e.story??e.ask,f=ht(p);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"cdim",children:i?"Grows while you talk. Add to it from any message. The spec is written when you press Write the spec.":"What the squad works from. Add to it from any message with Add to spec."}),t.jsx("h3",{children:"Story"}),t.jsx("div",{className:Bs(f),dir:f.dir,children:t.jsx(Kt,{text:p,dir:f.dir})}),t.jsx("h3",{children:"Done when"}),o.length?o.map((m,x)=>t.jsx(Ic,{text:m.text,chk:!0,fresh:r(m.at)},x)):t.jsx("p",{className:"cdim",children:"Nothing yet."}),l.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Rules"}),l.map((m,x)=>t.jsx(Ic,{text:m.text,fresh:r(m.at)},x))]}),u.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Notes"}),u.map((m,x)=>t.jsx(Ic,{text:m.text,fresh:r(m.at)},x))]}),d.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Still open"}),d.map((m,x)=>t.jsx(Ic,{text:m,tone:"open"},x))]})]})}function lq({id:e,all:n,pick:s,doc:r,setDoc:i}){const o=Qo(e).data,l=zu(),u=Gt(),{theme:d,toggleTheme:p}=Le(),f=o?.chat,m=o?Ab(o):null,x=n.filter(j=>j.open||j.id===e),y=C.useRef(null);return C.useEffect(()=>{y.current?.querySelector(".cv.on")?.scrollIntoView({block:"nearest",inline:"nearest"})},[e,x.length]),t.jsxs("div",{className:"cphone",children:[t.jsxs("header",{className:"cph-h",children:[t.jsx("button",{className:"ib",onClick:()=>r?i(null):void u({to:"/board"}),"aria-label":r?"Close the document":"Back to the board",children:t.jsx(ak,{size:22})}),f&&t.jsx(Dn,{role:f.with,live:f.thinking}),t.jsxs("div",{className:"cph-who",children:[t.jsxs("div",{children:[t.jsx("b",{children:f?pt[f.with]:"Conversations"})," ",o&&t.jsx("span",{className:"cid",children:o.id})]}),m&&t.jsx("div",{className:`cph-stage ${m.tone}`,children:m.text})]}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"ib",onClick:p,"aria-label":d==="light"?"Switch to dark":"Switch to light",children:d==="light"?t.jsx(Ko,{size:18}):t.jsx(Yo,{size:18})})]}),x.length>1&&t.jsx("div",{className:"cph-convs",role:"tablist","aria-label":"Conversations",ref:y,children:x.map(j=>{const k=j.id===e,b=i1(j,l.seen);return t.jsxs("button",{className:`cv ${k?"on":""}`,role:"tab","aria-selected":k,"aria-label":`${pt[j.with]} on ${j.id}`,onClick:()=>s(j.id),children:[t.jsx(Dn,{role:j.with,small:!0}),j.id,j.thinking&&!k&&t.jsxs("span",{className:`cdots sm c-${j.with}`,children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),b>0&&!k&&t.jsx("span",{className:"cbadge",children:b})]},j.id)})}),e?t.jsx(Zm,{id:e,size:"phone",onOpenDoc:i},e):t.jsx("div",{className:"cempty",children:"No talks yet."}),r&&t.jsx("div",{className:"cph-doc",children:t.jsx(Wm,{doc:r,onClose:()=>i(null)})})]})}function cq(){return $e({queryKey:["overview"],queryFn:()=>Se("/api/v1/overview"),refetchInterval:e=>e.state.data?.talk?.thinking||e.state.data?.handover==="reading"?1e3:3e3})}function uq(e){return e?new Date(e).toDateString()===new Date().toDateString()?`Read today at ${Wn(e)}`:`Read on ${Ws(e)}`:""}function dq(){const e=cq(),n=pe(),s=Gt(),[r,i]=C.useState(!1),[o,l]=C.useState(!1),u=e.data;if(e.isLoading)return t.jsx("div",{className:"center",children:"Loading the overview…"});if(!u)return t.jsx("div",{className:"center",children:"No overview yet."});const d=f=>void s({to:"/board",search:{ticket:f.id}}),p=u.empty&&u.handover==="ready"&&(!u.idea||o);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx(D,{as:"h1",text:u.project}),u.readAt&&!u.empty&&t.jsx("span",{className:"note ob-read",children:uq(u.readAt)}),t.jsx("span",{className:"grow"}),u.handover!=="reading"&&!u.empty&&t.jsxs("button",{className:"btn",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/overview/read-again",done:"The Architect reads the project again"}),children:[t.jsx(Vr,{size:14})," Read it again"]}),t.jsx(re,{text:u.command})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page ob-page",children:[u.handover==="reading"&&t.jsx(gw,{}),p&&t.jsx(hq,{v:u,onSent:()=>l(!1),onWrite:()=>i(!0)}),u.handover==="ready"&&!p&&!u.talk?.open&&t.jsx(pq,{v:u,...u.empty?{onChange:()=>l(!0)}:{}}),u.talk?.open&&t.jsx(fq,{t:u.talk}),u.brd&&t.jsxs("div",{className:"ob-card ready",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:"Your stories start from your BRD"}),t.jsxs("span",{children:["There is no code yet. The Analyst reads ",t.jsx(D,{text:u.brd.title})," and asks only about real gaps. You approve the stories, then the squad builds them."]})]}),t.jsxs(Ce,{to:"/requirements/$id",params:{id:u.brd.id},className:"btn pri",children:["Open the BRD ",t.jsx(Vi,{size:15})]})]}),u.handover==="approved"&&u.approved&&t.jsxs("div",{className:"calmlane ob-approved",children:[t.jsx("span",{className:"glyph",children:t.jsx(ge,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsxs("b",{children:[u.approved.by," approved this on ",Ws(u.approved.at),"."]})," ",u.rules.length?"The squad follows these rules. ":"","This page stays up to date after every merged ticket."]})]}),u.old&&t.jsxs("div",{className:"ob-card",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:"Read by an older squad-kit"}),t.jsx("span",{children:"Read it again to see who uses it, what it can do today, how its parts fit together and three ticket ideas."})]}),t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:"/api/v1/overview/read-again",done:"The Architect reads the project again"}),children:"Read it again"})]}),u.empty?!p&&!u.brd&&u.handover!=="reading"&&t.jsxs("div",{className:"ob-row2",children:[t.jsx(ij,{v:u}),t.jsx(aj,{v:u,onCreated:d,onWrite:()=>i(!0)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"ob-row2",children:[t.jsx(ij,{v:u}),t.jsx(mq,{v:u})]}),u.parts.length>0?t.jsx(gq,{v:u}):u.map.length>0?t.jsx(xq,{v:u}):null,t.jsxs("div",{className:"ob-row3",children:[t.jsx(yq,{v:u}),t.jsx(jq,{v:u}),t.jsx(aj,{v:u,onCreated:d,onWrite:()=>i(!0)})]}),t.jsxs("p",{className:"note ob-foot",children:["Kept in .squad/knowledge, updated after every merged ticket. Decisions and their history are on the ",t.jsx(Ce,{to:"/architecture",children:"Architecture page"}),"."]})]})]})}),r&&t.jsx(Tb,{onClose:()=>i(!1),onCreated:d})]})}function hq({v:e,onSent:n,onWrite:s}){const r=pe(),[i,o]=C.useState(e.idea??""),l=()=>{!i.trim()||r.isPending||r.mutate({path:"/api/v1/overview/idea",body:{text:i},done:"The Architect is reading what you want to build"},{onSuccess:n})};return t.jsxs("section",{className:"ob-talk ob-ask","aria-label":"What do you want to build?",children:[t.jsxs("div",{className:"ob-talk-h",children:[t.jsx(Dn,{role:"architect",small:!0}),t.jsx("h2",{children:"What do you want to build?"})]}),t.jsx("p",{className:"note",children:"Say it in your own words, in Arabic or English. The Architect picks the technology itself when your first story is planned."}),t.jsxs("div",{className:"cbox ob-talk-box",children:[t.jsx("textarea",{className:"cta t-mx",rows:3,dir:xe(i),value:i,placeholder:"For example: a page where staff write down visitors' names and see today's list","aria-label":"What you want to build",onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&!u.nativeEvent.isComposing&&(u.preventDefault(),l())}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"csend","aria-label":"Send",disabled:!i.trim()||r.isPending,onClick:l,children:t.jsx(js,{size:17})})]})]}),t.jsxs("div",{className:"ob-talk-f",children:[t.jsx("button",{className:"ob-link",onClick:s,children:"Or write your first ticket yourself."}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:'squad overview --build "…"'})]})]})}function pq({v:e,onChange:n}){const s=pe(),r=e.proposed;return t.jsxs("section",{className:"ob-hand","aria-label":"Check the overview",children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:e.empty?"The Architect wrote down what you want to build. Check it, then start.":e.approved&&r?`squad-kit found ${r} new ${r===1?"rule":"rules"} in your code. Check them, then carry on.`:"squad-kit has read your project. Check what it understood, then start."}),t.jsx("span",{children:r?`When you approve, the ${r} ${r===1?"rule":"rules"} below become the rules every agent follows.`:"When you approve, this page becomes the project’s home."})]}),t.jsxs("span",{className:"ob-hand-acts",children:[n?t.jsxs("button",{className:"btn",disabled:s.isPending,onClick:n,children:[t.jsx(Bn,{size:14})," Change what I said"]}):t.jsxs("button",{className:"btn",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/overview/talk",body:{}}),children:[t.jsx(Bn,{size:14})," Something is wrong"]}),t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/overview/approve",done:e.empty?"Approved. Start with your first story.":"Approved. The squad follows these rules now. Start with a ticket."}),children:[t.jsx(ge,{size:15})," Looks right, start working"]}),t.jsx(re,{text:"squad overview --approve"})]})]})}function fq({t:e}){const n=pe(),[s,r]=Ne("overview","talk",""),i=e.messages.some(l=>l.who==="you"),o=(l=s)=>{!l.trim()||e.thinking||n.isPending||n.mutate({path:"/api/v1/overview/talk",body:{text:l}},{onSuccess:()=>r("")})};return t.jsxs("section",{className:"ob-talk","aria-label":"Talk with the Architect",children:[t.jsxs("div",{className:"ob-talk-h",children:[t.jsx(Dn,{role:"architect",small:!0}),t.jsx("b",{children:"Tell the Architect what is wrong"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn","aria-label":"Close the talk",onClick:()=>n.mutate({path:"/api/v1/overview/talk/close"}),children:t.jsx(Qe,{size:15})})]}),t.jsxs("div",{className:"ob-thread ccol",children:[e.messages.map((l,u)=>l.who==="you"?t.jsxs("div",{className:"cyou cmsg",children:[t.jsx("div",{className:"cybub",children:t.jsx(Ao,{text:l.text,ticket:""})}),t.jsxs("span",{className:"cmeta",children:["You · ",Wn(l.at)]})]},u):l.who==="squad"?t.jsx("div",{className:"cnote-w cmsg",children:t.jsx(D,{className:"cnote-pill",text:l.text})},u):t.jsxs("div",{className:"cag cmsg ag-architect",children:[t.jsx(Dn,{role:"architect"}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:"Architect"}),t.jsx("span",{className:"ctime",children:Wn(l.at)})]}),t.jsxs("div",{className:"cagb",children:[t.jsx(Ao,{text:l.text,ticket:""}),l.options&&l.options.length>0&&u===e.messages.length-1&&t.jsx("div",{className:"cchoices",children:l.options.map(d=>t.jsx("button",{className:"cch",onClick:()=>o(d),children:t.jsx(D,{text:d})},d))})]})]},u)),e.thinking&&t.jsxs("div",{className:"cag cmsg ag-architect thinking",children:[t.jsx(Dn,{role:"architect",live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:"Architect"}),t.jsx("span",{className:"shim",children:i?"Reading your message":"Looking at what it wrote"})]}),t.jsx("div",{className:"cagb",children:t.jsxs("span",{className:"cdots","aria-label":"The Architect is answering",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})})]})]}),t.jsxs("div",{className:"cbox ob-talk-box",children:[t.jsx("textarea",{className:"cta t-en",rows:2,dir:xe(s),value:s,placeholder:"What did squad-kit get wrong? In Arabic or English","aria-label":"Your message",onChange:l=>r(l.target.value),onKeyDown:l=>{l.key==="Enter"&&!l.shiftKey&&!l.nativeEvent.isComposing&&(l.preventDefault(),o())}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),e.thinking?t.jsxs("button",{className:"cstop",onClick:()=>n.mutate({path:"/api/v1/overview/talk/stop"}),children:[t.jsx(is,{size:12,fill:"currentColor"})," Stop"]}):t.jsx("button",{className:"csend","aria-label":"Send",disabled:!s.trim()||n.isPending,onClick:()=>o(),children:t.jsx(js,{size:17})})]})]}),t.jsxs("div",{className:"ob-talk-f",children:[t.jsxs("button",{className:"btn pri",disabled:!i||e.thinking||n.isPending,onClick:()=>n.mutate({path:"/api/v1/overview/talk/read-again",done:"The Architect reads the project again with what you said"}),children:[t.jsx(Vr,{size:14})," Read it again with this"]}),t.jsx("span",{className:"note",children:"The Architect reads the whole project again with what you said. You check the overview again after."}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:'squad overview --wrong "…"'})]})]})}function ij({v:e}){const n=[...e.can.map(s=>({text:s,id:""})),...e.since.map(s=>({text:s.title,id:s.id}))];return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"What it is"}),e.summary?t.jsx(D,{as:"p",className:"ob-lead",text:e.summary}):t.jsx("p",{className:"note",children:"squad-kit has not read the project yet."}),e.empty&&t.jsx("p",{children:"No code yet. The Architect picks the technology when your first story is planned, and saves it as a decision engineers can see."}),(e.users||n.length>0)&&t.jsxs("div",{className:"ob-two",children:[e.users&&t.jsxs("div",{children:[t.jsx("div",{className:"ob-k",children:"Who uses it"}),t.jsx(D,{as:"p",text:e.users})]}),n.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"ob-k",children:"What it can do today"}),t.jsx("ul",{className:"ob-list",children:n.map((s,r)=>t.jsx(D,{as:"li",text:s.text,children:s.id&&t.jsxs(Ce,{to:"/board",search:{ticket:s.id},className:"pill ok sm ob-new",title:"Merged since the first read",children:["new · ",s.id]})},r))})]})]})]})}function mq({v:e}){const n=e.proof,[s,r]=C.useState(null);return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"Proof squad-kit can work here"}),n?t.jsxs("ul",{className:"ob-proof",children:[n.files!==void 0&&t.jsxs("li",{className:"ok",children:[t.jsx(ge,{size:14})," ",n.files?`Read the project: ${n.files} ${n.files===1?"file":"files"}`:"Read the project"]}),(n.tests??[]).map((i,o)=>t.jsxs("li",{className:i.ok?"ok":"bad",children:[i.ok?t.jsx(ge,{size:14}):t.jsx(jr,{size:14}),t.jsxs("span",{children:[i.ok?`Ran your tests: ${i.passed!==void 0?`${i.passed} pass`:"they pass"}`:"Your tests did not pass here",!i.ok&&i.output&&t.jsx("button",{className:"btn sm quiet",onClick:()=>r(s===o?null:o),children:s===o?"Hide":"See what failed"})]}),s===o&&i.output&&t.jsx("pre",{className:"ob-out",children:`${i.command}:
668
+ ${i.output}`})]},o)),n.tests?.length===0&&t.jsxs("li",{className:"skip",children:[t.jsx(jr,{size:14})," No tests yet. Your first ticket can add some."]}),n.app&&t.jsxs("li",{className:n.app.ok?"ok":"bad",children:[n.app.ok?t.jsx(ge,{size:14}):t.jsx(jr,{size:14}),t.jsx("span",{children:n.app.ok?"Opened the app":"The app did not open here"})]}),n.app?.shot&&t.jsx("li",{className:"ob-shot",children:t.jsx("img",{src:`${ss(`/api/v1/proof/${n.app.shot}`)}&v=${encodeURIComponent(e.readAt??"")}`,alt:"The app's first page, as squad-kit opened it"})}),n.branch&&t.jsxs("li",{className:"ok",children:[t.jsx(ge,{size:14})," ",n.unsaved?`${n.unsaved} changes here are not saved yet: squad-kit works from what is saved`:"All the code here is saved"]})]}):t.jsx("p",{className:"note",children:e.handover==="reading"?"Comes when the setup has tried your tests and your app.":"Read it again to have squad-kit run your tests and open your app once."})]})}function gq({v:e}){const[n,s]=C.useState(null),{columns:r,below:i}=N7(e.parts,e.links),o=l=>{const u=S7(l,e.parts,e.links);return t.jsxs("button",{className:`ob-node k-${l.kind??"part"} ${n===l.id?"on":""}`,onClick:()=>s(n===l.id?null:l.id),"aria-expanded":n===l.id,children:[t.jsx(D,{as:"b",text:l.name}),l.what&&t.jsx(D,{text:l.what}),l.files.length>0&&n===l.id&&t.jsx("code",{children:l.files.join(`
669
+ `)}),n===l.id&&u&&t.jsx("small",{children:u})]},l.id)};return t.jsxs("section",{className:"ob-c",children:[t.jsxs("div",{className:"ob-c-h",children:[t.jsx("h3",{children:"How it fits together"}),t.jsx("span",{className:"note",children:"Click a box to see its files"})]}),t.jsx("div",{className:"ob-flow",children:r.map((l,u)=>t.jsxs("div",{className:"ob-col-w",children:[u>0&&t.jsxs("span",{className:"ob-arw","aria-hidden":!0,children:[t.jsx(Vi,{size:16,className:"h"}),t.jsx(UN,{size:16,className:"v"})]}),t.jsx("div",{className:"ob-col",children:l.map(o)})]},u))}),i.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"ob-checks","aria-hidden":!0,children:"↑ checks ↑"}),t.jsx("div",{className:"ob-below",children:i.map(o)})]}),e.product&&t.jsxs("p",{className:"ob-product",children:[t.jsx(D,{text:e.product})," ",t.jsx(Ce,{to:"/settings",className:"ob-more",children:"An engineer can correct this in Settings"})]})]})}function xq({v:e}){return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"The project map"}),e.map.map(n=>t.jsxs("div",{className:"maprow",children:[t.jsx(D,{as:"b",text:n.area}),t.jsx(D,{text:n.detail})]},n.area))]})}function yq({v:e}){const n=e.rules,s=n.filter(r=>r.fromScan).length;return t.jsxs("section",{className:"ob-c",children:[t.jsxs("h3",{children:["Rules the squad ",e.proposed?"will follow":"follows"]}),t.jsx("div",{className:"note",children:n.length?s===n.length?`${s}, taken from your code`:`${n.length}: ${s} from your code, ${n.length-s} from tickets`:"None yet. The Architect proposes them with your first ticket."}),t.jsx("ul",{className:"ob-list",children:n.slice(0,10).map(r=>t.jsx(D,{as:"li",title:r.why,text:r.title,children:r.proposed&&e.handover!=="ready"&&t.jsx("span",{className:"pill you sm ob-new",children:"proposed"})},r.id))}),n.length>0&&t.jsx(Ce,{to:"/architecture",search:{view:"list"},className:"ob-more",children:"Review them one by one"})]})}function jq({v:e}){return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"Worth knowing"}),e.worth.length?t.jsx("ul",{className:"ob-list ob-worth",children:e.worth.map((n,s)=>t.jsx(D,{as:"li",text:n},s))}):t.jsx("p",{className:"note",children:"Nothing yet."})]})}function aj({v:e,onCreated:n,onWrite:s}){const r=pe();return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:e.empty?"Your first stories":e.since.length&&!e.ideas.length?"What next":"Good first tickets"}),t.jsx("ul",{className:"ob-ideas",children:e.ideas.map((i,o)=>t.jsxs("li",{children:[t.jsxs("span",{...De(i.title),children:[t.jsx(D,{as:"b",text:i.title}),i.why&&t.jsx(D,{as:"small",text:i.why})]}),i.ticket?t.jsx(Ce,{to:"/board",search:{ticket:i.ticket},className:"btn sm",children:i.ticket}):t.jsx("button",{className:"btn sm",disabled:r.isPending,title:`squad overview --idea ${o+1}`,onClick:()=>r.mutate({path:`/api/v1/overview/ideas/${o+1}`,done:"On the board. The Analyst reads it first."},{onSuccess:l=>n(l)}),children:"Create"})]},o))}),t.jsxs("p",{className:"note",children:[e.ideas.length?e.empty?"Ideas from what you said. Or ":"Ideas from what the Architect saw. Or ":"",t.jsx("button",{className:"ob-link",onClick:s,children:e.ideas.length?"write your own.":e.since.length?"Write a new ticket.":"Write your first ticket."})]}),e.ideas.some(i=>!i.ticket)&&t.jsx(re,{text:`squad overview --idea ${e.ideas.findIndex(i=>!i.ticket)+1}`}),!e.ideas.length&&t.jsxs("button",{className:"btn sm pri",onClick:s,children:[t.jsx(Nt,{size:14})," New ticket"]})]})}function kq(){const e=Yu(),n=pe(),{theme:s,toggleTheme:r}=Le(),i=e.data?.setup,o=i?i.steps.some(l=>l.state==="now"||l.state==="todo")&&!i.steps.some(l=>l.state==="stopped"||l.id==="read"&&l.state==="failed"):!1;return t.jsxs("div",{className:"ob-setup",children:[t.jsxs("header",{className:"cpage-h",children:[t.jsxs(Ce,{to:"/board",className:"btn",children:[t.jsx(hk,{size:15})," See the board meanwhile"]}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad setup"}),t.jsx("button",{className:"iconbtn",onClick:r,"aria-label":s==="light"?"Switch to dark":"Switch to light",children:s==="light"?t.jsx(Ko,{size:16}):t.jsx(Yo,{size:16})})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"ob-setup-b",children:e.isLoading?null:i?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"ob-head",children:[t.jsx("div",{className:"ob-proj",children:i.project}),t.jsx("h2",{children:i.approved?"Your project is set up":i.ready?i.empty?"Your new project is ready":"squad-kit knows your project now":"Getting to know your project"}),t.jsx("p",{children:i.ready||i.approved?i.empty?"Tell the Architect what you want to build, on the Overview.":"Check what it understood on the Overview, then start your first ticket.":i.kind==="empty"?"A few seconds for a new project. You can leave this page: we will tell you when it is ready.":"About 3 to 5 minutes. You can leave this page: we will tell you when it is ready."})]}),t.jsx(OF,{s:i}),i.ready&&!i.approved&&t.jsxs("div",{className:"ob-card ready",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(ge,{size:16,strokeWidth:2.5})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:i.empty?i.idea?"Your first stories are ready":"One question for you":"Your project overview is ready"}),t.jsx("span",{children:i.empty?i.idea?"What the Architect understood from what you said, for you to check.":"What do you want to build?":"What squad-kit understood, for you to check before the first ticket."})]}),t.jsxs(Ce,{to:"/overview",className:"btn pri",children:[i.empty&&!i.idea?"Answer it":"Check what squad-kit understood"," ",t.jsx(Vi,{size:15})]})]}),t.jsxs("div",{className:"ob-acts",children:[t.jsx(qF,{s:i}),o&&t.jsx("button",{className:"btn",disabled:n.isPending||i.stopping,onClick:()=>n.mutate({path:"/api/v1/setup/stop",done:"Stopped. Start it again any time."}),children:i.stopping?"Stopping…":"Stop"}),o&&t.jsx(re,{text:"squad setup --stop"}),t.jsx("span",{className:"grow"}),t.jsx(_F,{s:i})]}),!i.approved&&t.jsx(MF,{s:i})]}):t.jsxs("div",{className:"ob-head",children:[t.jsx("h2",{children:"This project is set up"}),t.jsxs("p",{children:["See what squad-kit understood on the ",t.jsx(Ce,{to:"/overview",children:"Overview"}),"."]})]})})})]})}const ns=e=>`/api/v1/requirements/${encodeURIComponent(e)}`;function vq(e,n){const[s,r]=C.useState(Date.now());return C.useEffect(()=>{if(!n)return;const i=setInterval(()=>r(Date.now()),e);return()=>clearInterval(i)},[e,n]),s}function bq({s:e}){return t.jsx("span",{className:`rq-dot ${e.state}`,"aria-hidden":"true",children:e.state==="done"?t.jsx(ge,{size:12,strokeWidth:3.2}):e.state==="now"?t.jsx("i",{}):null})}const wq={done:"Done",now:"Now",todo:"Still to come",failed:"Stopped here"};function N1({v:e}){const n=At();return!e.mine||!e.state.job?.heldFor?null:e.state.job.heldFor==="long"?t.jsxs("button",{className:"btn pri",disabled:n.isPending,title:`squad requirements retry ${e.id}`,onClick:()=>n.mutate({path:`${ns(e.id)}/retry`,done:"The Analyst starts reading."}),children:[t.jsx(Sn,{size:13})," Read it"]}):t.jsxs("button",{className:"btn pri",disabled:n.isPending,title:`squad requirements retry ${e.id}`,onClick:()=>n.mutate({path:`${ns(e.id)}/retry`,done:"The Analyst goes on past this month's budget, for the rest of the month."}),children:[t.jsx(Sn,{size:13})," Carry on"]})}function Nq({v:e}){const n=At(),s=e.state.job,r=ri(s),i=vq(5e3,r),o=D7(e),l=s?.status==="stopping",u=e.status==="drafting"?"The Analyst is writing the breakdown":"The Analyst is reading your BRD";return t.jsxs("section",{className:"rq-card rq-reading","aria-label":u,children:[t.jsxs("div",{className:"rq-reading-head",children:[t.jsx("h2",{children:u}),t.jsx("span",{className:"rq-clock",children:O7(s,i)})]}),t.jsx("ol",{className:"rq-steps",children:o.map(d=>t.jsxs("li",{className:`rq-step ${d.state}`,children:[t.jsx(bq,{s:d}),t.jsxs("div",{className:"rq-step-t",children:[t.jsxs("b",{children:[d.title,t.jsxs("span",{className:"sr-only",children:[": ",wq[d.state]]})]}),t.jsx(D,{text:d.sub}),d.bar&&d.state==="now"&&t.jsxs("span",{className:"rq-readbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":d.bar.of,"aria-valuenow":d.bar.done,"aria-label":"How far the Analyst read",children:[t.jsx("i",{style:{flexGrow:Math.max(0,d.bar.done)}}),t.jsx("em",{style:{flexGrow:Math.max(0,d.bar.of-d.bar.done)}})]})]})]},d.key))}),t.jsxs("div",{className:"rq-reading-foot",children:[t.jsx("p",{children:"You can leave this page. Waiting for you tells you when the Analyst needs you."}),t.jsx(N1,{v:e}),e.mine&&r&&t.jsxs("button",{className:"btn",disabled:l||n.isPending,title:`squad requirements stop ${e.id}`,onClick:()=>n.mutate({path:`${ns(e.id)}/stop`,done:"Stopping the Analyst. Try again carries on from here."}),children:[t.jsx(is,{size:13})," ",l?"Stopping…":"Stop"]})]})]})}function Sq({v:e}){const n=At(),s=Gt(),[r,i]=C.useState(!1),o=/^You stopped\b/.test(e.error??e.state.job?.error??""),l=!!e.state.job?.capped,u=o?"You stopped the Analyst":l?"The Analyst reached its limit":"The Analyst stopped";return t.jsx(Km,{calm:o,title:u,what:t.jsx(D,{as:"div",text:J7(e.error??e.state.job?.error??"The read did not get through.",u)}),safe:["Your document is saved.",...e.epics.length?["What the Analyst wrote so far is kept."]:[]],hint:t.jsx(re,{text:`squad requirements ${l?"more":"retry"} ${e.id}`}),ways:e.mine?[l?{label:"Give it more",primary:!0,icon:t.jsx(Nt,{size:14}),onClick:()=>n.mutate({path:`${ns(e.id)}/more`,done:"The Analyst carries on with more room."}),disabled:n.isPending,title:`squad requirements more ${e.id}. It carries on where it stopped, with twice the turns and spend for this step.`}:{label:"Try again",primary:!0,icon:t.jsx(Kr,{size:14}),onClick:()=>n.mutate({path:`${ns(e.id)}/retry`,done:"The Analyst carries on."}),disabled:n.isPending,title:`squad requirements retry ${e.id}`},...r?[{label:"Yes, delete it",icon:t.jsx(Cn,{size:14}),title:`squad requirements delete ${e.id}`,disabled:n.isPending,onClick:()=>n.mutate({path:ns(e.id),method:"DELETE",done:`Deleted ${e.id}.`},{onSuccess:()=>void s({to:"/requirements"})})},{label:"Keep it",onClick:()=>i(!1)}]:[{label:"Delete this breakdown",icon:t.jsx(Cn,{size:14}),onClick:()=>i(!0),title:"Deletes the breakdown and its document"}]]:[]})}function Cq({v:e,onOpenRef:n}){const s=At(),[r,i]=C.useState(()=>Object.fromEntries(e.questions.filter(m=>m.answer).map(m=>[m.id,m.answer]))),o=e.questions,l=m=>{const x=r[m];return!!(x&&(x.choice!=="Other"||x.value?.trim()))},u=o.every(m=>l(m.id)),d=ri(e.state.job)&&e.state.job?.step!=="reply",p=e.decided.length,f=()=>{if(!o.filter(y=>l(y.id)).length)return s.mutate({path:`${ns(e.id)}/skip`,done:"The Analyst decides the open questions and writes each one down."});const x=Object.fromEntries(o.map(y=>[y.id,l(y.id)?r[y.id]:{choice:dy}]));s.mutate({path:`${ns(e.id)}/answers`,body:{answers:x},done:"Answers sent. The Analyst decides the rest and writes the breakdown."})};return t.jsxs("div",{className:"rq-questions",children:[t.jsxs("div",{className:"rq-qhead",children:[t.jsx("span",{className:"rq-qn","aria-hidden":"true",children:o.length}),t.jsxs("h2",{children:["The Analyst has ",o.length," ",o.length===1?"question":"questions"]})]}),t.jsxs("p",{className:"rq-qlead",children:["The rest of the BRD is clear.",p>0&&` The Analyst decided ${p} small ${p===1?"thing":"things"} itself and wrote each one down. You will see them in the breakdown and can change any of them.`]}),e.state.job?.status==="failed"&&e.state.job.step==="reply"&&t.jsxs("div",{className:"rq-err",role:"alert",children:["The Analyst could not answer your question",e.state.job.error?t.jsxs(t.Fragment,{children:[": ",t.jsx(D,{text:e.state.job.error})]}):"."," ",e.mine&&t.jsx("button",{className:"rq-link",onClick:()=>s.mutate({path:`${ns(e.id)}/${e.state.job?.capped?"more":"retry"}`,done:"The Analyst tries to answer again."}),children:e.state.job.capped?"Give it more":"Try again"})]}),e.state.job?.heldFor==="budget"&&e.state.job.step==="reply"&&t.jsxs("div",{className:"rq-jobline",role:"status",children:[t.jsx(D,{text:e.state.job.now??""}),t.jsx(N1,{v:e})]}),o.map((m,x)=>t.jsx($q,{v:e,q:m,n:x+1,answer:r[m.id],onAnswer:y=>i(j=>({...j,[m.id]:y})),onOpenRef:n},m.id)),e.mine&&t.jsxs("div",{className:"rq-qfoot",children:[t.jsx(re,{text:`squad requirements answer ${e.id}`}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn",disabled:s.isPending||d,onClick:f,title:`squad requirements answer ${e.id} --skip`,children:dy}),t.jsxs("button",{className:"btn you",disabled:!u||s.isPending||d,onClick:()=>s.mutate({path:`${ns(e.id)}/answers`,body:{answers:r},done:"Answers sent. The Analyst writes the breakdown now."}),children:[t.jsx(ws,{size:14})," Send answers"]})]})]})}function $q({v:e,q:n,n:s,answer:r,onAnswer:i,onOpenRef:o}){const l=At(),[u,d]=Ne(e.id,`ask-${n.id}`,""),[p,f]=C.useState(!!u),m=`q-${e.id}-${n.id}`,x=()=>{u.trim()&&(l.mutate({path:`${ns(e.id)}/questions/${n.id}/ask`,body:{text:u}},{onSuccess:()=>d("")}),f(!1))},y=r?.choice==="Other";return t.jsxs("fieldset",{className:"rq-q",children:[t.jsxs("legend",{className:"sr-only",children:["Question ",s]}),t.jsxs("div",{className:"rq-qtop",children:[t.jsx("span",{className:`rq-tag ${n.kind==="clash"?"clash":"gap"}`,children:n.kind==="clash"?"Two parts clash":"Missing in the BRD"}),t.jsxs("span",{className:"rq-qsrc",children:[(n.refs??[]).map((j,k)=>t.jsxs("span",{children:[k>0&&(k===(n.refs?.length??0)-1?" and ":", "),t.jsx("button",{className:"rq-link",onClick:()=>o(j),title:"Open this place in the document",children:t.jsx(D,{text:W7(j)})})]},k)),n.refs?.length&&n.impact?" · ":"",n.impact&&t.jsx(D,{text:n.impact})]})]}),t.jsx(D,{as:"div",className:"rq-qt",text:n.text}),(n.thread?.length||n.thinking)&&t.jsxs("div",{className:"thread",dir:De(n.text).dir,children:[n.thread?.map((j,k)=>t.jsxs("div",{className:`msg ${j.who==="you"?"":"squad"}`,children:[t.jsx("small",{children:j.who==="you"?"You":Ms[j.who]}),t.jsx(D,{as:"div",text:j.text})]},k)),n.thinking&&t.jsxs("div",{className:"msg squad",children:[t.jsx("small",{children:"Analyst"}),t.jsxs("span",{className:"typing","aria-label":"Writing a reply",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]})]}),n.options.map(j=>t.jsxs("label",{className:`rq-opt ${r?.choice===j?"on":""}`,...De(j),children:[t.jsx("input",{type:"radio",name:m,checked:r?.choice===j,onChange:()=>i({choice:j}),disabled:!e.mine}),t.jsx(D,{text:j})]},j)),t.jsxs("label",{className:`rq-opt ${y?"on":""}`,children:[t.jsx("input",{type:"radio",name:m,checked:y,onChange:()=>i({choice:"Other",value:r?.value??""}),disabled:!e.mine}),"Something else…"]}),y&&t.jsx("input",{className:"input rq-own",autoFocus:!0,"aria-label":"Your answer",placeholder:"Your answer",dir:xe(r?.value??""),value:r?.value??"",onChange:j=>i({choice:"Other",value:j.target.value})}),e.mine&&(p?t.jsxs("div",{className:"askrow",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:xe(u),value:u,onChange:j=>d(j.target.value),placeholder:"Ask the Analyst about this question","aria-label":"Your question to the Analyst",onKeyDown:j=>j.key==="Enter"&&x()}),t.jsx("button",{className:"btn",onClick:x,disabled:!u.trim()||l.isPending,children:"Ask"}),t.jsx("button",{className:"btn quiet",onClick:()=>f(!1),children:"Cancel"})]}):t.jsxs("button",{className:"asklink",onClick:()=>f(!0),disabled:n.thinking,title:`squad requirements ask ${e.id} ${n.id} "<text>"`,children:[t.jsx(Bn,{size:14})," Ask about this"]}))]})}const Wr=e=>`/api/v1/requirements/${encodeURIComponent(e)}`,vu={epic:"Epic",feature:"Feature",story:"Story"};function Do(e){return e.mine&&(e.status==="ready"||e.status==="approved")}function Tq(e){const n=e.state.job;return ri(n)&&n?.step==="redo"?n.item??null:null}function t3(e,n){const s=Tq(e);if(!s)return!1;if(s===e.id||s===n)return!0;const r=Un(e,s);return!r||r.level==="story"?!1:ii(r.item).some(i=>i.key===n)||r.level==="epic"&&r.epic.features.some(i=>i.key===n)}function zp({v:e,mode:n,selected:s,open:r,onToggle:i,onSelect:o,onDecide:l,onAdd:u}){const d=C.useMemo(()=>new Map(e.progress.map(y=>[y.key,y])),[e.progress]),p=Un(e,s),f=p?p.level==="epic"?p.epic.features[0]?.key??p.epic.key:p.feature?.key??p.epic.key:void 0,m=p?.epic.key,x=(y,j)=>t.jsx(Aq,{s:y,p:d.get(y.key),depth:j,mode:n,selected:s===y.key,onSelect:o,onDecide:l},y.key);return t.jsxs("section",{className:`rq-tree ${n} ${e.epics.some(y=>ii(y).some(j=>j.tracker))?"refs":""} ${o?"":"still"}`,"aria-label":"Breakdown",children:[e.epics.map(y=>{const j=r.has(y.key);return t.jsxs("div",{className:"rq-group",children:[t.jsx(oj,{level:"epic",item:y,depth:0,mode:n,isOpen:j,selected:s===y.key,progress:d,onToggle:i,onSelect:o}),j&&t.jsxs(t.Fragment,{children:[y.features.map(k=>{const b=r.has(k.key);return t.jsxs("div",{className:"rq-sub",children:[t.jsx(oj,{level:"feature",item:k,depth:1,mode:n,isOpen:b,selected:s===k.key,progress:d,onToggle:i,onSelect:o}),b&&k.stories.map(S=>x(S,2)),b&&!k.stories.length&&t.jsx("div",{className:"rq-none d2",children:"No stories yet."})]},k.key)}),y.stories.map(k=>x(k,1)),!y.features.length&&!y.stories.length&&t.jsx("div",{className:"rq-none d1",children:"Nothing under this epic yet."})]})]},y.key)}),!e.epics.length&&t.jsx("p",{className:"note rq-none",children:"No epics yet."}),u&&Do(e)&&t.jsxs("div",{className:"rq-adds",children:[t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>u("epic"),title:`squad requirements add-item ${e.id} --title "…"`,children:[t.jsx(Nt,{size:14})," Add an epic"]}),e.epics.length>0&&t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>u("feature",m??e.epics.at(-1)?.key),children:[t.jsx(Nt,{size:14})," Add a feature"]}),e.epics.length>0&&t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>u("story",f),children:[t.jsx(Nt,{size:14})," Add a story"]})]})]})}function n3({done:e,of:n}){return t.jsx("span",{className:"rq-pb","aria-hidden":"true",children:t.jsx("b",{style:{width:`${n?Math.round(e/n*100):0}%`}})})}function oj({level:e,item:n,depth:s,mode:r,isOpen:i,selected:o,progress:l,onToggle:u,onSelect:d}){const p=ii(n),f=lu(p,l),m=e==="feature"?p.filter(y=>l.get(y.key)?.state==="building").map(y=>y.key):[],x=e==="epic"?n.goal:void 0;return t.jsxs("div",{className:`rq-row ${e} d${s} ${o?"sel":""}`,children:[t.jsx("button",{className:"rq-fold","aria-expanded":i,"aria-label":`${i?"Fold":"Open"} ${n.title}`,onClick:()=>u(n.key),children:i?t.jsx(Jf,{size:14,strokeWidth:2.4}):t.jsx(Tu,{size:14,strokeWidth:2.4})}),t.jsxs(s3,{onClick:d&&(()=>d(n.key)),current:o,label:`${vu[e]} ${n.key} ${n.title}`,children:[t.jsx("span",{className:`rq-lv ${e}`,children:vu[e]}),t.jsx(D,{className:"rq-t",title:n.title,text:n.title}),r==="plan"&&x&&t.jsx(D,{className:"rq-meta rq-goal",text:x}),r==="build"&&m.length>0&&t.jsxs("span",{className:"rq-meta rq-live",children:[m.join(", ")," building"]}),t.jsx("span",{className:"grow"}),r==="plan"?t.jsx("span",{className:"rq-meta",children:Jk(n)}):t.jsxs(t.Fragment,{children:[t.jsx(n3,{...f}),t.jsxs("span",{className:"rq-meta rq-of",children:[f.done," of ",f.of]})]})]})]})}function s3({onClick:e,current:n,label:s,children:r}){return e?t.jsx("button",{className:"rq-main",onClick:e,"aria-current":n?"true":void 0,"aria-label":s,children:r}):t.jsx("div",{className:"rq-main",children:r})}function Eq({p:e}){const n=xm(e?.state);return t.jsxs("span",{className:`rq-st ${n} ${e?.state??"not-started"}`,children:[n==="m"?t.jsx(ge,{size:13,strokeWidth:3,"aria-hidden":"true"}):n==="b"?t.jsx("span",{className:"live","aria-hidden":"true"}):null,t.jsx(D,{className:"rq-stl",text:e?.line??"Not started"})]})}function Aq({s:e,p:n,depth:s,mode:r,selected:i,onSelect:o,onDecide:l}){const u=n?.state==="needs-you",d=e.tracker;return t.jsxs("div",{className:`rq-row story d${s} ${i?"sel":""} ${u?"you":""}`,onClick:o&&(()=>o(e.key)),children:[t.jsxs(s3,{onClick:o&&(()=>o(e.key)),current:i,label:`Story ${e.key} ${e.title}${n&&r==="build"?`: ${n.line}`:""}`,children:[r==="plan"&&t.jsx("span",{className:"rq-lv story",children:"Story"}),t.jsx("span",{className:"rq-id",children:e.key}),t.jsx(D,{className:"rq-t",title:e.title,text:e.title}),r==="plan"&&t.jsxs(t.Fragment,{children:[e.dependsOn.slice(0,2).map(p=>t.jsxs("span",{className:"rq-need",children:["needs ",p]},p)),e.dependsOn.length>2&&t.jsxs("span",{className:"rq-need",children:["+",e.dependsOn.length-2]}),!e.criteria.length&&t.jsx("span",{className:"rq-warn",children:'No "done when" yet'}),t.jsx("span",{className:"grow"}),e.ref?.section&&t.jsx("span",{className:"rq-meta rq-from",children:B7(e.ref.section)}),t.jsx("span",{className:"rq-meta rq-size",title:`Size ${e.size}`,children:e.size})]}),r==="build"&&t.jsx("span",{className:"rq-tk",children:n?.ticket??"–"})]}),r==="build"&&(d?.url?t.jsx("a",{className:"rq-ref",href:d.url,target:"_blank",rel:"noreferrer",title:`Open ${d.ref}`,onClick:p=>p.stopPropagation(),children:d.ref}):t.jsx("span",{className:"rq-ref",children:d?.ref??""})),r==="build"&&t.jsxs("span",{className:`rq-stcol ${u?"you":""}`,children:[t.jsx(Eq,{p:n}),u&&n?.ticket&&t.jsx("button",{className:"btn you sm",onClick:p=>{p.stopPropagation(),l(n.ticket)},"aria-label":`Decide on ${e.key} ${e.title}`,children:"Decide"})]})]})}function Pq(e){const n=Un(e.v,e.k);return n?n.level==="story"?t.jsx(Iq,{...e,f:n},n.item.key):t.jsx(Fq,{...e,f:n},n.item.key):null}function r3({f:e,onClose:n}){return t.jsxs("div",{className:"rq-ph",children:[t.jsx("span",{className:`rq-lv ${e.level}`,children:vu[e.level]}),t.jsx("span",{className:"rq-id",children:e.item.key}),t.jsx("span",{className:"rq-place",children:t.jsx(Tk,{path:U7(e)})}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn","aria-label":"Close",onClick:n,children:t.jsx(Qe,{size:15})})]})}const Rq=e=>({title:e.title,story:e.story,criteria:e.criteria.map(n=>({...n})),size:e.size,needs:[...e.dependsOn]}),ho=(e,n)=>JSON.stringify(e)===JSON.stringify(n);function i3(e,n,s){const r=Qi(wt,e,`panel-${n}`),[i,o]=C.useState(()=>Po(r)??s),[l,u]=C.useState({key:n,server:s}),d=!ho(i,l.server);return C.useEffect(()=>{d&&n===l.key?Um(r,i):Ro(r)},[r,i,d]),C.useEffect(()=>{if(n!==l.key){o(s),u({key:n,server:s});return}ho(s,l.server)||(!d||ho(i,s))&&(o(s),u({key:n,server:s}))},[n,s]),[i,o,d&&n===l.key,()=>o(l.server)]}function Iq({v:e,f:n,onClose:s,onSelect:r,onAsk:i,onOpenRef:o,onOpenTicket:l}){const u=n.story,d=At(),{toast:p}=Le(),f=e.progress.find(_=>_.key===u.key),m=!!(u.ticket&&f?.ticket),x=t3(e,u.key),y=Do(e)&&!m&&!x,j=C.useMemo(()=>Rq(u),[u]),[k,b,S,N]=i3(e.id,u.key,j),[$,A]=C.useState(!1),[R,E]=C.useState(!1),M=e.decided.filter(_=>_.item===u.key),F=G7(e,u),W=e.status==="approved",I=_=>Un(e,_)?.item.title??"",q=()=>{const _=gy(k.criteria);if(_.length!==k.criteria.length&&b(le=>({...le,criteria:gy(le.criteria)})),_.some(ip)){E(!0),requestAnimationFrame(()=>[...document.querySelectorAll(".rq-gwt.half textarea")].find(le=>!le.value.trim())?.focus());return}E(!1);const G={};k.title!==u.title&&(G.title=k.title),k.story!==u.story&&(G.story=k.story),ho(_,u.criteria)||(G.criteria=_),k.size!==u.size&&(G.size=k.size),ho(k.needs,u.dependsOn)||(G.needs=k.needs),Object.keys(G).length&&d.mutate({path:`${Wr(e.id)}/items/${u.key}`,method:"PATCH",body:G,done:`Saved ${u.key}.`})},L=(_,G,le)=>b(V=>({...V,criteria:V.criteria.map((Y,te)=>te===_?{...Y,[G]:le}:Y)})),U=wI(e,u.key,k.needs);return t.jsxs("aside",{className:"rq-panel","aria-label":`Story ${u.key}`,"data-dirty":S,children:[t.jsx(r3,{f:n,onClose:s}),t.jsxs("div",{className:"rq-pbody",children:[m&&t.jsxs("div",{className:`rq-started ${xm(f?.state)}`,children:[t.jsxs("span",{children:[t.jsx("b",{className:"mono",children:u.ticket})," ",t.jsx(D,{text:f?.line??""})]}),t.jsx("button",{className:`btn sm ${f?.state==="needs-you"?"you":""}`,onClick:()=>l(u.ticket),children:f?.state==="needs-you"?"Decide":"Open the ticket"})]}),m&&t.jsxs("p",{className:"note",children:["It started as ",u.ticket,", so it changes on its ticket now."]}),x&&t.jsx("p",{className:"rq-busy",children:"The Analyst is redoing this part. It shows here when it is done."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-st",children:"Title"}),y?t.jsx("input",{id:"rq-st",className:"input rq-titlein",dir:xe(k.title),value:k.title,onChange:_=>b(G=>({...G,title:_.target.value}))}):t.jsx(D,{as:"div",id:"rq-st",className:"rq-ro rq-titlein",text:u.title})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ss",children:"Story"}),y?t.jsx("textarea",{id:"rq-ss",className:"textarea rq-storyin",dir:xe(k.story),value:k.story,placeholder:"As a …, I want …, so that …",onChange:_=>b(G=>({...G,story:_.target.value}))}):u.story?t.jsx(D,{as:"div",id:"rq-ss",className:"rq-ro",text:u.story}):t.jsx("div",{id:"rq-ss",className:"rq-ro",children:t.jsx("span",{className:"note",children:"No story text yet."})})]}),t.jsx("div",{className:"rq-lab",children:"Done when"}),t.jsxs("div",{className:"rq-gwts",children:[k.criteria.map((_,G)=>t.jsxs("div",{className:`rq-gwt ${R&&ip(_)?"half":""}`,children:[["given","when","then"].map(le=>t.jsxs("label",{className:"rq-gwtrow",children:[t.jsx("b",{children:le.charAt(0).toUpperCase()+le.slice(1)}),y?t.jsx("textarea",{rows:Math.max(1,Math.ceil(_[le].length/40)),dir:xe(_[le]),value:_[le],onChange:V=>L(G,le,V.target.value.replace(/\n/g," ")),"aria-label":`Check ${G+1}: ${le}`}):t.jsx(D,{text:_[le]})]},le)),y&&t.jsx("button",{className:"rq-gwt-x","aria-label":`Remove check ${G+1}`,onClick:()=>b(le=>({...le,criteria:le.criteria.filter((V,Y)=>Y!==G)})),children:t.jsx(Qe,{size:13})}),R&&ip(_)&&t.jsx("p",{className:"rq-halfnote",role:"alert",children:"Fill in Given, When and Then, or remove this check. Your other changes are kept."})]},G)),!k.criteria.length&&t.jsx("p",{className:"rq-warnline",children:'No "done when" yet. A story needs at least one before you approve.'}),y&&t.jsx("button",{className:"rq-link",onClick:()=>b(_=>({..._,criteria:[..._.criteria,{given:"",when:"",then:""}]})),children:"+ Add a check"})]}),t.jsxs("div",{className:"rq-two",children:[t.jsxs("div",{className:"grow",children:[t.jsx("div",{className:"rq-lab",children:"Needs"}),t.jsxs("div",{className:"rq-needs",children:[k.needs.map(_=>t.jsxs("span",{className:"rq-need big",children:[t.jsxs("button",{className:"rq-needname",onClick:()=>r(_),title:`Open ${_} ${I(_)}`,children:[t.jsx("b",{children:_}),t.jsx(D,{text:I(_)})]}),y&&t.jsx("button",{"aria-label":`${u.key} does not need ${_}`,onClick:()=>b(G=>({...G,needs:G.needs.filter(le=>le!==_)})),children:t.jsx(Qe,{size:11})})]},_)),!k.needs.length&&!y&&t.jsx("span",{className:"note",children:"Nothing first"}),y&&U.length>0&&t.jsxs("select",{className:"rq-addneed","aria-label":`Add a story ${u.key} needs first`,value:"",onChange:_=>_.target.value&&b(G=>({...G,needs:[...G.needs,_.target.value]})),children:[t.jsx("option",{value:"",children:"+ Add"}),U.map(_=>t.jsx("option",{value:_.key,children:as(_.label)},_.key))]})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"rq-lab",children:"Size"}),t.jsx("div",{className:"seg rq-sizeseg",role:"group","aria-label":"Size",children:["S","M","L"].map(_=>t.jsx("button",{className:k.size===_?"on":"","aria-pressed":k.size===_,disabled:!y,onClick:()=>b(G=>({...G,size:_})),children:_},_))})]})]}),y&&t.jsx(a3,{v:e,f:n}),u.ref&&t.jsxs("div",{className:"rq-fromline",children:["From the BRD:"," ",t.jsx("button",{className:"rq-link",onClick:()=>o(u.ref),children:t.jsx(D,{text:Jo(u.ref)})})]}),M.length>0&&t.jsxs("div",{className:"rq-dbox",children:[t.jsx("div",{className:"rq-lab",children:"Decided for you"}),M.map(_=>t.jsx(S1,{v:e,d:_,compact:!0,onOpenTicket:l},`${_.ticket??""}${_.id}`))]}),W&&!m&&t.jsxs("div",{className:"rq-startbox",children:[t.jsxs("button",{className:"btn",disabled:F.length>0||d.isPending||!e.mine||!u.criteria.length||S,onClick:()=>d.mutate({path:`${Wr(e.id)}/items/${u.key}/start`},{onSuccess:_=>p(`${u.key} started as ${_.ticket?.id??"a ticket"}. It builds by itself.`)}),title:`squad requirements start ${e.id} ${u.key}`,children:[t.jsx(Sn,{size:13})," Start this story now"]}),t.jsx("span",{className:"note",children:F.length?`It starts after ${F.join(", ")} ${F.length===1?"merges":"merge"}.`:S?"Save your changes first.":u.ticket?"Its ticket was deleted. This makes a new one that builds by itself.":"It becomes a ticket that builds by itself."})]}),!m&&t.jsx(re,{text:W?`squad requirements start ${e.id} ${u.key}`:`squad requirements edit ${e.id} ${u.key} --title ${Me(k.title)}`})]}),y&&t.jsx("div",{className:"rq-pf",children:$?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"rq-sure",children:["Remove ",u.key,"? It goes out of other stories' needs too."]}),t.jsx("button",{className:"btn danger",onClick:()=>d.mutate({path:`${Wr(e.id)}/items/${u.key}`,method:"DELETE",done:`Removed ${u.key}.`},{onSuccess:()=>r(void 0)}),children:"Remove"}),t.jsx("button",{className:"btn",onClick:()=>A(!1),children:"Keep it"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:()=>i(u.key),title:`squad requirements redo ${e.id} ${u.key} "<what to change>"`,children:"Ask the Analyst to redo this"}),S?t.jsx("button",{className:"btn quiet",onClick:()=>{N(),E(!1)},children:"Undo"}):t.jsx("button",{className:"btn quiet",onClick:()=>A(!0),title:`squad requirements remove ${e.id} ${u.key}`,children:"Remove"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",disabled:!S||d.isPending,onClick:q,children:"Save"})]})})]})}function a3({v:e,f:n}){const s=At(),r=H7(e,n),i=V7(n);return r.length<2?null:t.jsxs("div",{className:"field rq-move",children:[t.jsx("label",{htmlFor:`rq-move-${n.item.key}`,children:"Move to"}),t.jsx("select",{id:`rq-move-${n.item.key}`,className:"select",value:i,title:`squad requirements move ${e.id} ${n.item.key} --under <key>`,onChange:o=>o.target.value!==i&&s.mutate({path:`${Wr(e.id)}/items/${n.item.key}/move`,body:{under:o.target.value},done:`Moved ${n.item.key}.`}),children:r.map(o=>t.jsx("option",{value:o.key,children:as(o.label)},o.key))})]})}function Fq({v:e,f:n,onClose:s,onSelect:r,onAsk:i,onOpenRef:o,onOpenTicket:l,onAdd:u}){const d=At(),p=n.level==="epic",f=n.item,m=p?f.goal??"":f.summary??"",x=C.useMemo(()=>({title:f.title,about:m}),[f.title,m]),[y,j,k,b]=i3(e.id,f.key,x),[S,N]=C.useState(!1),$=t3(e,f.key),A=ii(f),R=new Map(e.progress.map(q=>[q.key,q])),E=A.filter(q=>q.ticket&&R.get(q.key)?.ticket),M=Do(e)&&!$,F=lu(A,R),W=e.decided.filter(q=>q.item===f.key),I=()=>d.mutate({path:`${Wr(e.id)}/items/${f.key}`,method:"PATCH",body:{...y.title!==f.title?{title:y.title}:{},...y.about!==m?p?{goal:y.about}:{summary:y.about}:{}},done:`Saved ${f.key}.`});return t.jsxs("aside",{className:"rq-panel","aria-label":`${vu[n.level]} ${f.key}`,"data-dirty":k,children:[t.jsx(r3,{f:n,onClose:s}),t.jsxs("div",{className:"rq-pbody",children:[$&&t.jsx("p",{className:"rq-busy",children:"The Analyst is redoing this part. It shows here when it is done."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-gt",children:"Title"}),M?t.jsx("input",{id:"rq-gt",className:"input rq-titlein",dir:xe(y.title),value:y.title,onChange:q=>j(L=>({...L,title:q.target.value}))}):t.jsx(D,{as:"div",id:"rq-gt",className:"rq-ro rq-titlein",text:f.title})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ga",children:p?"What it is for":"What it covers"}),M?t.jsx("textarea",{id:"rq-ga",className:"textarea rq-storyin",dir:xe(y.about),value:y.about,onChange:q=>j(L=>({...L,about:q.target.value}))}):m?t.jsx(D,{as:"div",id:"rq-ga",className:"rq-ro",text:m}):t.jsx("div",{id:"rq-ga",className:"rq-ro",children:t.jsx("span",{className:"note",children:"Nothing written yet."})})]}),t.jsxs("div",{className:"rq-stats",children:[t.jsx("span",{children:Jk(f)}),e.status==="approved"&&A.length>0&&t.jsxs("span",{children:[t.jsx(n3,{...F})," ",F.done," of ",F.of," merged"]})]}),M&&n.level==="feature"&&t.jsx(a3,{v:e,f:n}),f.ref&&t.jsxs("div",{className:"rq-fromline",children:["From the BRD:"," ",t.jsx("button",{className:"rq-link",onClick:()=>o(f.ref),children:t.jsx(D,{text:Jo(f.ref)})})]}),W.length>0&&t.jsxs("div",{className:"rq-dbox",children:[t.jsx("div",{className:"rq-lab",children:"Decided for you"}),W.map(q=>t.jsx(S1,{v:e,d:q,compact:!0,onOpenTicket:l},`${q.ticket??""}${q.id}`))]}),Do(e)&&t.jsxs("div",{className:"rq-hereadds",children:[p&&t.jsx("button",{className:"rq-link",onClick:()=>u("feature",f.key),children:"+ Add a feature here"}),t.jsx("button",{className:"rq-link",onClick:()=>u("story",p?f.features[0]?.key??f.key:f.key),children:"+ Add a story here"})]}),t.jsx(re,{text:`squad requirements edit ${e.id} ${f.key} --title ${Me(y.title)}`})]}),M&&t.jsx("div",{className:"rq-pf",children:S?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-sure",children:E.length?`${f.key} has stories that started, so it stays. Move them out first.`:`Remove ${f.key} and the ${A.length} ${A.length===1?"story":"stories"} under it?`}),!E.length&&t.jsxs("button",{className:"btn danger",onClick:()=>d.mutate({path:`${Wr(e.id)}/items/${f.key}`,method:"DELETE",done:`Removed ${f.key}.`},{onSuccess:()=>r(void 0)}),children:[t.jsx(Cn,{size:13})," Remove"]}),t.jsx("button",{className:"btn",onClick:()=>N(!1),children:E.length?"OK":"Keep it"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:()=>i(f.key),title:`squad requirements redo ${e.id} ${f.key} "<what to change>"`,children:"Ask the Analyst to redo this"}),k?t.jsx("button",{className:"btn quiet",onClick:b,children:"Undo"}):t.jsx("button",{className:"btn quiet",onClick:()=>N(!0),title:`squad requirements remove ${e.id} ${f.key}`,children:"Remove"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",disabled:!k||!y.title.trim()||d.isPending,onClick:I,children:"Save"})]})})]})}function S1({v:e,d:n,compact:s,onSelect:r,onOpenTicket:i}){const o=At(),{toast:l}=Le(),[u,d]=Ne(n.ticket??e.id,`decided-${n.id}`,""),[p,f]=C.useState(!!u),m=!n.ticket&&e.wholeRedo&&!(n.item&&Un(e,n.item))?e.wholeRedo:null,[x,y]=C.useState(!1),j=n.ticket?`/api/v1/tickets/${encodeURIComponent(n.ticket)}/decided/${n.id}`:`${Wr(e.id)}/decided/${n.id}`,k=n.ticket?`squad decided ${n.ticket} ${n.id} ${Me(u.trim()||"<text>")}`:`squad requirements decided ${e.id} ${n.id} ${Me(u.trim()||"<text>")}`,b=()=>o.mutate({path:j,body:{text:u.trim(),...m?{whole:!0}:{}},...n.ticket?{}:{done:`Changed. The Analyst redoes ${m?"the breakdown":n.item??"the breakdown"} with it.`}},{onSuccess:$=>{f(!1),y(!1),d(""),n.ticket&&l(sv(n.ticket,$?.decided?.find(A=>A.id===n.id)?.changed?.ticket))}}),S=n.changed?.ticket,N=S?/^c\d+$/.test(S)?n.ticket:S:void 0;return t.jsxs("div",{className:`rq-dec ${s?"compact":""}`,children:[!s&&t.jsx("div",{className:"rq-dw",children:r&&n.item?t.jsx("button",{className:"rq-link mono",onClick:()=>r(n.item),children:my(n)}):my(n)}),n.changed?t.jsx(D,{as:"div",className:"rq-dt",text:n.changed.text,children:t.jsxs("span",{className:"rq-was",...De(n.text),children:[t.jsx("bdi",{dir:"ltr",children:"Was:"})," ",t.jsx(D,{text:n.text}),S&&t.jsxs(t.Fragment,{children:[" · ",N&&i?t.jsx("button",{className:"rq-link rq-now",onClick:()=>i(N),title:`Open ${N}`,children:/^c\d+$/.test(S)?`now change ${S} on ${n.ticket}`:`now ${S}`}):/^c\d+$/.test(S)?`now change ${S} on ${n.ticket}`:`now ${S}`]})]})}):t.jsx(D,{as:"div",className:"rq-dt",text:n.text,children:s&&n.by==="answer"&&t.jsx("span",{className:"rq-was",dir:"ltr",children:"From your answer"})}),p?t.jsxs("div",{className:"rq-dedit",children:[t.jsx("textarea",{className:"textarea",autoFocus:!0,dir:xe(u),value:u,onChange:$=>d($.target.value),"aria-label":"What you want instead",placeholder:"What should it be instead?"}),x&&t.jsx("p",{className:"note",role:"alert",children:m}),t.jsxs("div",{className:"rq-dedit-b",children:[t.jsx("button",{className:"btn sm pri",disabled:!u.trim()||o.isPending,onClick:()=>m&&!x?y(!0):b(),children:x?"Yes, rewrite all of it":"Save change"}),t.jsx("button",{className:"btn sm",onClick:()=>x?y(!1):f(!1),children:x?"Keep it as it is":"Cancel"}),t.jsx(re,{text:k})]})]}):!n.changed&&e.mine&&t.jsx("button",{className:"rq-link",onClick:()=>f(!0),"aria-label":`Change: ${n.text}`,children:"Change"})]})}function zq({v:e,onSelect:n,onOpenTicket:s,onClose:r}){const[i,o]=C.useState(!1),l=e.decided,u=i?l:l.slice(0,5),d=e.status==="approved"&&e.progress.some(p=>p.ticket);return t.jsx("aside",{className:"rq-panel rq-decided","aria-label":"Decided for you",children:t.jsxs("div",{className:"rq-pbody",children:[t.jsxs("div",{className:"rq-dtop",children:[t.jsxs("h2",{className:"rq-dhead",children:["Decided for you ",t.jsx("span",{children:l.length})]}),r&&t.jsx("button",{className:"iconbtn rq-dclose","aria-label":"Close",onClick:r,children:t.jsx(Qe,{size:15})})]}),t.jsxs("p",{className:"rq-dlead",children:["Small choices the squad made where the BRD says nothing. Change one and ",d?"it becomes a small change ticket":"the Analyst redoes the part it is about","."]}),u.map(p=>t.jsx(S1,{v:e,d:p,onSelect:n,onOpenTicket:s},`${p.ticket??""}${p.id}`)),!l.length&&t.jsx("p",{className:"note",children:"Nothing yet. When the squad decides a small thing itself, it shows here."}),l.length>5&&t.jsx("button",{className:"rq-link rq-showall",onClick:()=>o(!i),children:i?"Show fewer":`Show all ${l.length}`})]})})}const Fc={min:.3,max:1.6,step:.1},lj=e=>Math.round(e*100)/100;function Lq({v:e,selected:n,onSelect:s,onDecide:r}){const i=C.useMemo(()=>t9(e),[e.epics,e.progress]),o=C.useMemo(()=>new Map(i.boxes.map(V=>[V.key,V])),[i]),l=C.useRef(null),[u,d]=C.useState(1),[p,f]=C.useState(null),m=C.useMemo(()=>new Map(e.progress.map(V=>[V.key,V])),[e.progress]),x=e.progress.filter(V=>V.state==="needs-you").map(V=>V.key),[y,j]=C.useState(x[0]??null),k=Ke(),b=k.data?.ready?k.data.tickets:[],S=y?o.get(y):void 0,N=S?n9(i,S):null,$=N?.height??i.height,A=()=>{const V=l.current;V&&d(s9({width:i.width,height:$},{width:V.clientWidth-16,height:V.clientHeight-16}))};C.useLayoutEffect(()=>{const V=l.current;V&&d(r9(i,{width:V.clientWidth-16}))},[]),C.useEffect(()=>{y&&!x.includes(y)&&j(x[0]??null)},[x.join()]);const R=C.useRef(null),E=V=>{if(V.target.closest("button"))return;const Y=l.current;R.current={x:V.clientX,y:V.clientY,left:Y.scrollLeft,top:Y.scrollTop},Y.setPointerCapture(V.pointerId)},M=V=>{const Y=R.current;Y&&(l.current.scrollLeft=Y.left-(V.clientX-Y.x),l.current.scrollTop=Y.top-(V.clientY-Y.y))},F=()=>R.current=null,I=Un(e,p??n??null??void 0),q=I?.story?[...I.story.dependsOn.map(V=>({from:V,to:I.story.key})),...py(e,I.story.key).map(V=>({from:I.story.key,to:V}))].filter(V=>o.has(V.from)&&o.has(V.to)):[],L=y?m.get(y):void 0,U=L?.ticket?b.find(V=>V.id===L.ticket):void 0,_=y?py(e,y):[],G=U?.agentQuestion?.text?tv(U.agentQuestion.text):U?.waiting?.summary??Un(e,y??void 0)?.item.title??"",le=V=>{V.level==="story"&&m.get(V.key)?.state==="needs-you"?j(V.key):(j(null),s(V.key))};return t.jsxs("div",{className:"rq-map",children:[t.jsxs("div",{className:"rq-zoom",role:"group","aria-label":"Zoom",children:[t.jsx("button",{className:"btn sm","aria-label":"Zoom out",onClick:()=>d(V=>Math.max(Fc.min,lj(V-Fc.step))),children:"−"}),t.jsx("button",{className:"btn sm","aria-label":"Zoom in",onClick:()=>d(V=>Math.min(Fc.max,lj(V+Fc.step))),children:"+"}),t.jsx("button",{className:"btn sm",onClick:A,children:"Fit"})]}),t.jsx("div",{className:"rq-mapview",ref:l,onPointerDown:E,onPointerMove:M,onPointerUp:F,onPointerCancel:F,children:t.jsx("div",{className:"rq-mapsize",style:{width:i.width*u,height:$*u},children:t.jsxs("div",{className:"rq-mapcanvas",style:{width:i.width,height:$,transform:`scale(${u})`},children:[t.jsxs("svg",{className:"rq-lines",width:i.width,height:$,"aria-hidden":"true",children:[i.lines.map((V,Y)=>t.jsx("line",{x1:V.x1,y1:V.y1,x2:V.x2,y2:V.y2},Y)),q.map(V=>{const Y=o.get(V.from),te=o.get(V.to),P=Math.abs(Y.x-te.x)<2,B=P?Y.x+Y.w:Y.x+(te.x>Y.x?Y.w:0),J=P?te.x+te.w:te.x+(te.x>Y.x?0:te.w),z=Y.y+Y.h/2,ye=te.y+te.h/2,fe=P?34:Math.max(30,Math.abs(J-B)/2),ve=P?B+fe:B+(te.x>Y.x?fe:-fe),Fe=P?J+fe:J+(te.x>Y.x?-fe:fe);return t.jsx("path",{className:"rq-needline",d:`M${B},${z} C${ve},${z} ${Fe},${ye} ${J},${ye}`,markerEnd:"url(#rq-arrow)"},`${V.from}-${V.to}`)}),t.jsx("defs",{children:t.jsx("marker",{id:"rq-arrow",viewBox:"0 0 8 8",refX:"7",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L8,4 L0,8 z",className:"rq-arrowhead"})})})]}),i.boxes.map(V=>{const Y=m.get(V.key),te={left:V.x,top:V.y,width:V.w,height:V.h};if(V.level==="story")return t.jsx("button",{className:`rq-chip ${xm(V.state)} ${n===V.key?"sel":""}`,style:te,title:`${V.key} ${V.title}${Y?`: ${Y.line}`:""}`,"aria-label":`Story ${V.key} ${V.title}${Y?`: ${Y.line}`:""}`,onClick:()=>le(V),onMouseEnter:()=>f(V.key),onMouseLeave:()=>f(null),onFocus:()=>f(V.key),onBlur:()=>f(null),children:t.jsx(D,{className:"rq-chipt",lead:t.jsx("em",{children:V.key}),text:V.title})},V.key);const P=V.done?.of?Math.round(V.done.done/V.done.of*100):0;return t.jsxs("button",{className:`rq-box ${V.level} ${n===V.key?"sel":""}`,style:te,onClick:()=>le(V),title:V.title,"aria-label":`${V.level==="epic"?"Epic":"Feature"} ${V.key} ${V.title}, ${V.done?.done??0} of ${V.done?.of??0} merged`,children:[t.jsx(D,{className:"n",text:V.title}),t.jsxs("span",{className:"p",children:[t.jsx("i",{children:t.jsx("b",{style:{width:`${P}%`}})}),V.level==="epic"?`${V.done?.done??0} of ${V.done?.of??0}`:`${V.done?.done??0}/${V.done?.of??0}`]})]},V.key)}),S&&L&&N&&t.jsxs("div",{className:"rq-pop",style:{left:N.left,top:N.top,width:Is.popW},role:"dialog","aria-label":`${S.key} needs you`,children:[t.jsx("button",{className:"rq-pop-x","aria-label":"Close",onClick:()=>j(null),children:t.jsx(Qe,{size:13})}),t.jsx("div",{className:"rq-pop-w",children:[S.key,L.ticket,ev(L.stop)].filter(Boolean).join(" · ")}),t.jsx(D,{as:"div",className:"rq-pop-t",text:G}),t.jsxs("div",{className:"rq-pop-s",children:[_.length?`${_.join(", ")} ${_.length===1?"waits":"wait"} for it. `:"",e.state.build?.on?"Everything else keeps going.":""]}),L.ticket&&t.jsx("button",{className:"btn sm you",onClick:()=>r(L.ticket),children:"Decide"})]})]})})}),t.jsxs("div",{className:"rq-legend",children:[t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"m"}),"Merged"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"b"}),"Building"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"y"}),"Needs you"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"w"}),"Not started"]}),t.jsx("span",{children:"Click a box to open it. Drag to move around."})]})]})}const Ur=e=>`/api/v1/requirements/${encodeURIComponent(e)}`;function o3({text:e,tone:n}){return t.jsxs("span",{className:`rq-chip-s ${n}`,children:[t.jsx("i",{"aria-hidden":"true"}),e]})}function Mq(){const e=zb(),n=Ke(),s=n.data?.ready?n.data.meta.user?.name:void 0,[r,i]=C.useState(!1),o=e.data?.breakdowns??[],l=n.data?.brokenRecords?.filter(u=>u.kind==="breakdown")??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Requirements"}),t.jsx("span",{className:"grow"}),t.jsx(re,{text:"squad requirements list"}),t.jsxs("button",{className:"btn pri",onClick:()=>i(!0),children:[t.jsx(Nt,{size:15})," Add a BRD"]})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page rq-list",children:[l.length>0&&t.jsx(Oo,{list:l,label:"Breakdowns that could not be read"}),e.isLoading?t.jsx("p",{className:"note",children:"Reading your breakdowns…"}):e.isError?t.jsxs("p",{className:"rq-err",role:"alert",children:["squad-kit could not read the breakdowns. ",Zi(e.error)]}):o.length?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note rq-lead",children:"Each BRD you add is one breakdown. Open one to edit it, approve it, send it or build it."}),t.jsx("div",{className:"rq-rows",children:o.map(u=>t.jsx(qq,{r:u,me:s},u.id))})]}):t.jsxs("div",{className:"rq-empty",children:[t.jsx("span",{className:"ring",children:t.jsx(fk,{size:20})}),t.jsxs("div",{children:[t.jsx("h2",{children:"Turn a BRD into stories the squad can build"}),t.jsx("p",{children:"Add your business requirements document: a PDF, a Word file, Markdown or text. The Analyst reads it, asks you only about parts that are missing or that clash, and breaks it into epics, features and stories for you to edit and approve. Nothing is built or sent anywhere until you approve."}),t.jsxs("button",{className:"btn pri",onClick:()=>i(!0),children:[t.jsx(Nt,{size:15})," Add a BRD"]})]})]})]})}),r&&t.jsx(gI,{onClose:()=>i(!1)})]})}function qq({r:e,me:n}){const[s,r]=C.useState(!1),i=R7(e),o=e.counts,l=e.status==="approved"&&(o.merged>0||o.building>0||o.needsYou>0||e.building),u=!n||e.owner.trim().toLowerCase()===n.trim().toLowerCase();return t.jsxs("div",{className:`rq-rowcard ${e.status==="questions"||o.needsYou?"you":""}`,children:[t.jsx(Oq,{r:e,chip:i,started:l}),u&&t.jsx(Ub,{label:`More actions for ${e.id}`,choices:[{key:"delete",danger:!0,title:`squad requirements delete ${e.id}`,label:t.jsxs(t.Fragment,{children:[t.jsx(Cn,{size:15})," Delete breakdown…"]}),onPick:()=>r(!0)}]}),s&&t.jsx(Wb,{id:e.id,title:e.title,onClose:()=>r(!1)})]})}function Oq({r:e,chip:n,started:s}){const r=e.counts;return t.jsxs(Ce,{to:"/requirements/$id",params:{id:e.id},className:"rq-rowlink",children:[t.jsx("span",{className:"rq-rid mono",children:e.id}),t.jsxs("span",{className:"rq-rname",children:[t.jsx(D,{as:"b",text:e.title}),t.jsxs("span",{...De(e.source.name),children:[t.jsx(Eu,{size:12,"aria-hidden":"true"})," ",t.jsx(D,{text:e.source.name})]})]}),t.jsx("span",{className:"rq-rcount",children:r.epics||r.stories?I7(r):"Not broken down yet"}),t.jsxs("span",{className:"rq-rstate",children:[t.jsx(o3,{...n}),r.needsYou>0&&t.jsxs("span",{className:"rq-rneeds",children:[r.needsYou," ",r.needsYou===1?"needs":"need"," you"]})]}),t.jsx("span",{className:"rq-rprog",children:s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-pb","aria-hidden":"true",children:t.jsx("b",{style:{width:`${r.stories?Math.round(r.merged/r.stories*100):0}%`}})}),t.jsxs("span",{className:"rq-meta",children:[r.merged," of ",r.stories," merged"]})]})})]})}function _q(){const{id:e}=Su({from:"/requirements/$id"}),n=ei({from:"/requirements/$id"}),s=Gt({from:"/requirements/$id"}),r=uI(e),i=r.data,o=sa(ra),l=p=>void s({search:f=>({...f,...p}),replace:!0}),u=p=>l({item:p,decided:void 0}),d=p=>l({ticket:p});return r.isLoading?t.jsxs("div",{className:"center",children:["Opening ",e,"…"]}):i?t.jsx(Dq,{v:i,search:n,select:u,openTicket:d,setSearch:l,phone:o}):t.jsx("div",{className:"center",children:t.jsxs("div",{children:[t.jsx("h2",{children:/404/.test(String(r.error))?`No breakdown ${e}`:`squad-kit could not open ${e}`}),t.jsx("p",{children:/404/.test(String(r.error))?"It may have been deleted.":Zi(r.error)}),t.jsx("p",{style:{marginTop:12},children:t.jsx(Ce,{to:"/requirements",className:"btn",children:"All breakdowns"})})]})})}function Dq({v:e,search:n,select:s,openTicket:r,setSearch:i,phone:o}){const l=At(),u=Gt(),{toast:d}=Le(),[p,f]=C.useState(null),m=Vb(e),[x,y]=C.useState(()=>fy(e,n.item)),j=L=>y(U=>{const _=new Set(U);return _.has(L)?_.delete(L):_.add(L),_});C.useEffect(()=>{e.epics.length&&y(L=>L.size?L:fy(e,n.item))},[e.epics.length]),C.useEffect(()=>{const L=Un(e,n.item);L&&y(U=>U.has(L.epic.key)&&(!L.feature||U.has(L.feature.key))?U:new Set([...U,L.epic.key,...L.feature?[L.feature.key]:[]]))},[n.item,e.epics.length]);const k=e.status==="ready"||e.status==="approved",b=n.view==="map"&&k&&!o,S=e.status==="approved"?"build":"plan",N=Un(e,n.item)?n.item:void 0,$=!!e.state.build?.on,A=Qk(e),R=Do(e)&&!ri(e.state.job),E=!!(p||n.ticket||m.viewer!==void 0);C.useEffect(()=>{if(!N||E)return;const L=U=>{if(U.key!=="Escape"||U.defaultPrevented||document.querySelector(".modal-veil"))return;const _=U.target instanceof HTMLElement?U.target:null;if(_&&/^(INPUT|TEXTAREA|SELECT)$/.test(_.tagName))return _.closest(".rq-panel")?_.blur():void 0;if(document.querySelector('.rq-panel[data-dirty="true"]'))return d("Save or undo your changes first.");s(void 0)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[N,E]);const M=t.jsx(Wq,{v:e,onSend:()=>f({kind:"send"}),onAsk:()=>f({kind:"ask",item:e.id}),phone:o}),F=e.mine?[...e.status==="approved"&&R&&el(e).some(({story:L})=>!L.ticket)?[{key:"ask",title:`squad requirements redo ${e.id} ${e.id} "<what to change>"`,label:t.jsxs(t.Fragment,{children:[t.jsx(Bn,{size:15})," Ask the Analyst…"]}),onPick:()=>f({kind:"ask",item:e.id})}]:[],{key:"delete",danger:!0,title:`squad requirements delete ${e.id}`,label:t.jsxs(t.Fragment,{children:[t.jsx(Cn,{size:15})," Delete breakdown…"]}),onPick:()=>f({kind:"delete"})}]:[],W=b?`squad requirements show ${e.id} --map`:e.status==="approved"&&e.mine&&e.counts.merged<e.counts.stories?`squad requirements build ${e.id}${$?" --pause":""}`:`squad requirements show ${e.id}`,I=N?t.jsx(Pq,{v:e,k:N,onClose:()=>s(void 0),onSelect:s,onAsk:L=>f({kind:"ask",item:L}),onOpenRef:m.open,onOpenTicket:r,onAdd:(L,U)=>f({kind:"add",level:L,under:U})}):null,q=L=>t.jsx(zq,{v:e,onSelect:s,onOpenTicket:r,onClose:L});return t.jsxs("div",{className:`rq ${o?"phone":""}`,children:[t.jsxs("header",{className:"rq-head",children:[t.jsxs("div",{className:"rq-h1row",children:[t.jsxs("div",{className:"rq-titlecol",children:[t.jsxs("div",{className:"rq-crumbs",children:[t.jsx(Ce,{to:"/requirements",children:"Requirements"})," › ",e.id,e.status==="questions"&&t.jsxs(t.Fragment,{children:[" › ",t.jsx(D,{text:e.title})]})]}),t.jsxs("div",{className:"rq-name",children:[t.jsx(Bq,{v:e}),t.jsx(o3,{...A})]})]}),t.jsx(re,{text:W,keep:W.slice(W.indexOf(e.id))}),k&&!o&&t.jsxs("div",{className:"seg rq-viewseg",role:"group","aria-label":"View",children:[t.jsx("button",{className:b?"":"on","aria-pressed":!b,onClick:()=>i({view:void 0}),children:"Tree"}),t.jsx("button",{className:b?"on":"","aria-pressed":b,onClick:()=>i({view:"map"}),children:"Map"})]}),!o&&M,t.jsx(Ub,{choices:F,label:`More actions for ${e.id}`})]}),k&&t.jsx(Vq,{v:e,onDecided:()=>i({item:void 0,decided:!0}),onLeftOut:()=>f({kind:"leftout"}),onDoc:()=>m.open()}),e.status==="approved"&&t.jsx(Kq,{v:e}),e.status==="ready"&&e.mine&&(e.problems?.length??0)>0&&t.jsxs("div",{className:"rq-probs",id:"rq-probs",role:"note",children:[t.jsx("b",{children:"Before you approve:"}),t.jsxs("ul",{children:[e.problems.slice(0,4).map(L=>t.jsx(D,{as:"li",text:L},L)),e.problems.length>4&&t.jsxs("li",{children:["and ",e.problems.length-4," more"]})]})]}),!e.mine&&t.jsxs("p",{className:"rq-notmine",children:[e.owner,"'s breakdown: only their squad builds it. You see it read only."]}),t.jsx(Yq,{v:e})]}),k?b?t.jsxs("div",{className:"rq-split",children:[t.jsx(Lq,{v:e,selected:N,onSelect:L=>s(L),onDecide:r}),I&&t.jsx("div",{className:"rq-aside over",children:I})]}):o?t.jsxs("div",{className:"scroll rq-phonebody",children:[t.jsx(Gq,{v:e,onDecide:r}),t.jsx("div",{className:"rq-phonetree",children:t.jsx(zp,{v:e,mode:S,selected:N,open:x,onToggle:j,onSelect:s,onDecide:r,onAdd:(L,U)=>f({kind:"add",level:L,under:U})})}),t.jsxs("p",{className:"rq-phonenote",children:["The map view is on bigger screens."," ",e.decided.length>0&&t.jsxs("button",{className:"rq-link",onClick:()=>i({item:void 0,decided:!0}),children:[e.decided.length," decided for you"]})]})]}):t.jsxs("div",{className:"rq-split",children:[t.jsx("div",{className:"scroll rq-treecol",children:t.jsx(zp,{v:e,mode:S,selected:N,open:x,onToggle:j,onSelect:s,onDecide:r,onAdd:(L,U)=>f({kind:"add",level:L,under:U})})}),t.jsx("div",{className:`rq-aside ${I?"":`idle ${n.decided?"wanted":""}`}`,children:I??q(n.decided?()=>i({decided:void 0}):void 0)})]}):t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"rq-pad",children:[e.status==="failed"?t.jsx(Sq,{v:e}):e.status==="questions"?t.jsx(Cq,{v:e,onOpenRef:m.open}):t.jsx(Nq,{v:e}),(e.status==="drafting"||e.status==="failed")&&e.epics.length>0&&t.jsxs("div",{className:"rq-sofar",children:[t.jsx("div",{className:"rq-lab",children:"What it wrote so far"}),t.jsx(zp,{v:e,mode:"plan",open:x,onToggle:j,onDecide:r})]})]})}),o&&k&&!b&&(I||n.decided)&&t.jsx("div",{className:"rq-sheet",children:I??q(()=>i({decided:void 0}))}),o&&k&&e.mine&&t.jsx("div",{className:"rq-bottom",children:M}),n.ticket&&t.jsx(Lw,{id:n.ticket,onClose:()=>i({ticket:void 0})}),p?.kind==="send"&&t.jsx(xI,{v:e,onClose:()=>f(null)}),p?.kind==="ask"&&t.jsx(yI,{v:e,item:p.item,text:p.text,onClose:()=>f(null)}),p?.kind==="add"&&t.jsx(jI,{v:e,level:p.level,under:p.under,onClose:()=>f(null),onAdded:L=>s(L)}),p?.kind==="leftout"&&t.jsx(kI,{v:e,onClose:()=>f(null),onOpenRef:m.open,onAsk:R?L=>f({kind:"ask",item:e.id,text:L}):void 0}),p?.kind==="delete"&&t.jsx(Wb,{id:e.id,title:e.title,sentTo:e.sent?e.tracker?.label:void 0,onClose:()=>f(null),onDeleted:()=>void u({to:"/requirements"})}),m.viewer!==void 0&&t.jsx(Hb,{v:e,at:m.viewer??void 0,onClose:m.close}),l.isPending&&t.jsx("span",{className:"sr-only",role:"status",children:"Working…"})]})}function Bq({v:e}){const n=At(),[s,r]=C.useState(!1),[i,o]=C.useState(e.title);if(!s)return t.jsxs(t.Fragment,{children:[t.jsx(D,{as:"h1",text:e.title}),e.mine&&t.jsx("button",{className:"iconbtn rq-rename","aria-label":"Rename the breakdown",title:`squad requirements rename ${e.id} "<name>"`,onClick:()=>{o(e.title),r(!0)},children:t.jsx(ru,{size:13})})]});const l=()=>n.mutate({path:Ur(e.id),method:"PATCH",body:{title:i.trim()},done:"Renamed."},{onSuccess:()=>r(!1)});return t.jsxs("form",{className:"rq-renameform",onSubmit:u=>{u.preventDefault(),i.trim()&&l()},children:[t.jsx("input",{className:"input",autoFocus:!0,"aria-label":"Name of the breakdown",dir:xe(i),value:i,onChange:u=>o(u.target.value),onKeyDown:u=>u.key==="Escape"&&r(!1)}),t.jsx("button",{className:"btn sm pri",type:"submit",disabled:!i.trim()||n.isPending,title:`squad requirements rename ${e.id} ${Me(i.trim()||e.title)}`,children:"Save"}),t.jsx("button",{className:"btn sm",type:"button",onClick:()=>r(!1),children:"Cancel"})]})}function Wq({v:e,onSend:n,onAsk:s,phone:r}){const i=At();if(!e.mine)return null;const o=ri(e.state.job),l=e.tracker&&t.jsxs("button",{className:"btn",onClick:n,disabled:e.state.sync?.status==="running",title:`squad requirements send ${e.id}`,children:[!r&&t.jsx(ws,{size:14})," ",e.sent?"Send changes":`Send to ${e.tracker.label}`]});if(e.status==="ready"){const m=e.problems??[];return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:s,disabled:o,title:`squad requirements redo ${e.id} ${e.id} "<what to change>"`,children:[!r&&t.jsx(Bn,{size:14})," Ask the Analyst"]}),t.jsxs("button",{className:"btn pri rq-approve",disabled:m.length>0||o||i.isPending,"aria-describedby":m.length?"rq-probs":void 0,title:m.length?m[0]:`squad requirements approve ${e.id}`,onClick:()=>i.mutate({path:`${Ur(e.id)}/approve`,done:e.tracker?"Approved. Build continuously, start a story, or send it.":"Approved. Build continuously, or start one story."}),children:[t.jsx(ge,{size:15})," Approve breakdown"]})]})}if(e.status!=="approved")return null;const u=e.counts.stories>0&&e.counts.merged===e.counts.stories,d=!!e.state.build?.on,p=e.state.build?.heldFor==="budget",f=e.state.build?.heldFor==="review";return t.jsxs(t.Fragment,{children:[l,!u&&d&&t.jsxs("button",{className:"btn",disabled:i.isPending,title:`squad requirements build ${e.id} --pause`,onClick:()=>i.mutate({path:`${Ur(e.id)}/build`,body:{on:!1},done:"Paused. Running stories finish their step; no new ones start."}),children:[t.jsx(Pu,{size:14})," Pause"]}),!u&&(!d||p||f)&&t.jsxs("button",{className:"btn pri",disabled:i.isPending,title:p?`Go on past this month's budget: squad requirements build ${e.id}`:`squad requirements build ${e.id}`,onClick:()=>i.mutate({path:`${Ur(e.id)}/build`,body:{on:!0},done:p?"It goes on past this month's budget, for the rest of the month.":f?"It goes on, with the rewritten stories.":"Building continuously. Stories start in order of what they need."}),children:[t.jsx(Sn,{size:14})," Build continuously"]})]})}function Lp(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function Uq(e,n){return n&&e.trim().toLowerCase()===n.trim().toLowerCase()?"you":e}function Hq(e){const n=new Date(e);return n.toDateString()===new Date().toDateString()?"today":`on ${n.toLocaleDateString("en-GB",{day:"numeric",month:"short"})}`}function Vq({v:e,onDecided:n,onLeftOut:s,onDoc:r}){const i=Ke(),o=i.data?.ready?i.data.meta.user?.name:void 0,l=e.source,u=e.estimate,d=gm(u),p=e.counts,f=e.status==="ready";return t.jsxs("div",{className:"rq-info",children:[t.jsxs("span",{children:["From"," ",t.jsx("button",{className:"rq-link",onClick:r,title:"Open the document",children:t.jsx(D,{text:l.name})}),l.kind==="pdf"&&l.pages?`, ${Lp(l.pages,"page")}`:"",l.pictures?`, ${Lp(l.pictures,"picture")}`:"",", added by ",t.jsx(D,{text:Uq(l.addedBy,o)})," ",Hq(l.addedAt)]}),t.jsxs("span",{children:[t.jsx("b",{children:p.epics})," ",p.epics===1?"epic":"epics",", ",t.jsx("b",{children:p.features})," ",p.features===1?"feature":"features",", ",t.jsx("b",{children:p.stories})," ",p.stories===1?"story":"stories"]}),f&&u.stories>0&&t.jsxs("span",{children:["About ",d.cost&&t.jsxs(t.Fragment,{children:[t.jsx("b",{children:d.cost})," and "]}),t.jsx("b",{children:d.time})," to build, ",u.parallel," at a time ",t.jsxs("span",{className:"rq-dim",children:["(",Zk(u),")"]})]}),e.decided.length>0&&t.jsxs("button",{className:"rq-link",onClick:n,children:[e.decided.length," decided for you"]}),e.leftOut.length>0&&t.jsxs("button",{className:"rq-link",onClick:s,children:[Lp(e.leftOut.length,"part")," left out"]}),e.sent&&e.tracker&&t.jsxs("span",{children:["Sent to ",e.tracker.label]})]})}function Kq({v:e}){const n=At(),s=e.counts,r=Y7(s),i=!!e.state.build?.on,o=e.state.build?.held,l=e.state.sync,u=s.merged+s.building+s.needsYou>0||e.progress.some(y=>y.ticket),d=Math.max(0,s.stories-s.merged-s.building-s.needsYou),p=X7(e),f=of(l,Ob(e.id)),m=nv(f),x="It stops only for a missing part, a clash or a failed check, and merges each story when its checks and review pass. You send releases out from Releases.";return t.jsxs("div",{className:"rq-build",children:[u||i?t.jsxs("div",{className:"rq-progress",children:[t.jsxs("span",{className:"rq-segbar",role:"img","aria-label":`${s.merged} of ${s.stories} stories merged, ${s.building} building, ${s.needsYou} need you`,children:[r.merged>0&&t.jsx("i",{className:"m",style:{flexGrow:r.merged}}),r.building>0&&t.jsx("i",{className:"b",style:{flexGrow:r.building}}),r.needsYou>0&&t.jsx("i",{className:"y",style:{flexGrow:r.needsYou}}),r.rest>0&&t.jsx("i",{className:"w",style:{flexGrow:r.rest}})]}),t.jsxs("span",{className:"rq-pnum",children:[t.jsxs("b",{children:[s.merged," of ",s.stories]})," ","merged"]}),t.jsx("span",{className:"rq-meta",children:[s.building?`${s.building} building`:"",s.needsYou?`${s.needsYou} ${s.needsYou===1?"needs":"need"} you`:"",d?`${d} to go`:""].filter(Boolean).join(", ")}),s.merged<s.stories&&t.jsx("span",{className:"rq-meta",children:M7(e.estimate)})]}):e.mine&&t.jsxs("div",{className:"rq-rule",children:["Build continuously: ",L7(e.estimate),". ",x]}),(u||i)&&i&&s.merged<s.stories&&t.jsxs("div",{className:"rq-rule",children:[e.estimate.parallel," at a time. ",x]}),p&&t.jsxs("div",{className:"rq-built",role:"status",children:[t.jsx(ge,{size:14,strokeWidth:2.6,"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx(D,{text:p.text}),p.release&&t.jsxs(t.Fragment,{children:[" ","Send it out from ",t.jsx(Ce,{to:"/releases",children:"Releases"}),"."]})]})]}),o&&(i||e.state.build?.heldFor==="budget")&&t.jsxs("div",{className:"rq-held",role:"status",children:[t.jsx(Pu,{size:13,"aria-hidden":"true"})," Waiting: ",t.jsx(D,{text:o})]}),l&&(l.status==="running"||l.status==="pending")&&t.jsxs("div",{className:"rq-syncline",role:"status",children:["Sending to ",e.tracker?.label??"the tracker",m?`: ${m}`:"…",t.jsx("span",{className:"rq-pbar",children:t.jsx("i",{style:{width:`${f.pct||5}%`}})})]}),l?.status==="failed"&&t.jsxs("div",{className:"rq-syncline fail",role:"alert",children:["The send to ",e.tracker?.label??"the tracker"," stopped",l.error?`: ${l.error}`:".",e.mine&&t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`${Ur(e.id)}/send`,done:"Sending again. What was sent stays; nothing is made twice."}),children:"Send again"})]})]})}function Yq({v:e}){const n=At(),s=e.state.job;return!ri(s)||e.status!=="ready"&&e.status!=="approved"?s?.status==="failed"&&s.step==="redo"&&(e.status==="ready"||e.status==="approved")?t.jsxs("div",{className:"rq-jobline fail",role:"status",children:["The redo of ",s.item===e.id?"the breakdown":s.item," stopped",s.error?t.jsxs(t.Fragment,{children:[": ",t.jsx(D,{text:s.error})]}):".",e.mine&&t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:`${Ur(e.id)}/${s.capped?"more":"retry"}`,done:"The Analyst tries the redo again."}),children:s.capped?"Give it more":"Try again"})]}):null:t.jsxs("div",{className:"rq-jobline",role:"status",children:[t.jsx("span",{className:"live","aria-hidden":"true"}),t.jsx(D,{text:s.status==="stopping"?"Stopping the Analyst…":`${s.now??"The Analyst is working"}${s.ask?`: "${s.ask}"`:""}`}),t.jsx(N1,{v:e}),e.mine&&s.status!=="stopping"&&t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:`${Ur(e.id)}/stop`,done:"Stopping the Analyst."}),title:`squad requirements stop ${e.id}`,children:"Stop"})]})}function Gq({v:e,onDecide:n}){const s=Ke(),r=s.data?.ready?s.data.tickets:[],i=e.progress.filter(l=>l.state==="needs-you"),o=C.useMemo(()=>i.map(l=>{const u=Un(e,l.key)?.story,d=l.ticket?r.find(f=>f.id===l.ticket):void 0,p=d?.agentQuestion?.text?tv(d.agentQuestion.text):d?.waiting?.summary;return t.jsxs("div",{className:"rq-youcard",children:[t.jsx("div",{className:"rq-pop-w",children:[l.key,l.ticket,ev(l.stop)].filter(Boolean).join(" · ")}),t.jsx(D,{as:"div",className:"rq-youcard-t",text:`${u?.title??""}${p?`: ${p.charAt(0).toLowerCase()}${p.slice(1)}`:""}`}),l.ticket&&t.jsx("button",{className:"btn you",onClick:()=>n(l.ticket),children:"Decide"})]},l.key)}),[i.map(l=>l.key+l.ticket).join(),r]);return t.jsx(t.Fragment,{children:o})}const zt=jN({component:wt?UF:GM,beforeLoad:({location:e})=>{if(!wt&&e.pathname!=="/")throw Wo({to:"/"})}}),Qq=qt({getParentRoute:()=>zt,path:"/",beforeLoad:()=>{if(wt)throw Wo({to:"/overview"})}}),Zq=qt({getParentRoute:()=>zt,path:"/setup",component:kq}),Xq=qt({getParentRoute:()=>zt,path:"/overview",component:dq}),Jq=qt({getParentRoute:()=>zt,path:"/requirements",component:Mq}),eO=qt({getParentRoute:()=>zt,path:"/requirements/$id",validateSearch:e=>({item:typeof e.item=="string"&&e.item?e.item:void 0,view:e.view==="map"?"map":void 0,ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0,decided:e.decided===!0||e.decided==="true"?!0:void 0}),component:_q}),tO=qt({getParentRoute:()=>zt,path:"/board",validateSearch:e=>({ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0,view:e.view==="mine"||e.view==="bugs"?e.view:void 0,write:e.write===1||e.write==="1"?1:void 0}),component:oL}),nO=qt({getParentRoute:()=>zt,path:"/tickets/$id/proof",component:dL}),sO=qt({getParentRoute:()=>zt,path:"/backlog",component:xL}),rO=qt({getParentRoute:()=>zt,path:"/inbox",component:KL}),iO=qt({getParentRoute:()=>zt,path:"/releases",component:hL}),aO=qt({getParentRoute:()=>zt,path:"/decisions",beforeLoad:()=>{throw Wo({to:"/architecture",search:{view:"list"}})}}),oO=qt({getParentRoute:()=>zt,path:"/architecture",validateSearch:e=>({adr:typeof e.adr=="string"&&e.adr?e.adr:void 0,view:["timeline","stack","list","project","lessons"].includes(e.view)?e.view:void 0}),component:kL}),lO=qt({getParentRoute:()=>zt,path:"/conversations",validateSearch:e=>({ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0}),component:tq}),cO=qt({getParentRoute:()=>zt,path:"/bugs",component:YL}),uO=qt({getParentRoute:()=>zt,path:"/harness",validateSearch:e=>({tab:["compare","limits","safety","agents","additions"].includes(e.tab)?e.tab:void 0}),component:bM}),dO=qt({getParentRoute:()=>zt,path:"/squad",beforeLoad:()=>{throw Wo({to:"/harness",search:{tab:"agents"}})}}),hO=qt({getParentRoute:()=>zt,path:"/settings",component:iM}),pO=zt.addChildren([Qq,Zq,Xq,Jq,eO,tO,sO,nO,rO,lO,iO,aO,oO,cO,uO,dO,hO]),fO=AN({routeTree:pO,defaultPreload:!1,basepath:Hi||"/",defaultErrorComponent:xw}),mO=2e3;function gO(){const e=zw(),n=Hn();C.useEffect(()=>{const r=()=>{fetch("/healthz",{cache:"no-store"}).then(()=>zN(),()=>Xj())},i=window.setInterval(r,mO);return()=>window.clearInterval(i)},[]);const s=C.useRef(e);return C.useEffect(()=>{e==="down"?document.documentElement.dataset.appDown="1":delete document.documentElement.dataset.appDown,e==="up"&&s.current!=="up"&&n.invalidateQueries(),s.current=e},[e,n]),e==="up"?null:t.jsxs("div",{className:"appdown",role:"alert",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(kr,{size:16})}),t.jsx("div",{className:"upd-main",children:e==="down"?t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"upd-title",children:"squad-kit has stopped, so this page is not up to date"}),t.jsx("span",{className:"upd-sub",children:"Your work and what you typed are safe. Start it again in a terminal. This page comes back by itself."})]}):t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"upd-title",children:"This page's link is out of date"}),t.jsx("span",{className:"upd-sub",children:"Run this in a terminal: it opens the board with a fresh link. What you typed is kept."})]})}),t.jsx("div",{className:"upd-acts",children:t.jsx(re,{text:"squad"})})]})}document.documentElement.dataset.theme=vk();const xO=new q5({defaultOptions:{queries:{staleTime:500,retry:1,refetchOnWindowFocus:!0}}}),l3=document.getElementById("root");if(!l3)throw new Error("missing #root");const yO=ON();uR();u5.createRoot(l3).render(t.jsx(C.StrictMode,{children:yO?t.jsx(O5,{client:xO,children:t.jsxs(oy,{children:[t.jsx(gO,{}),t.jsx(O2,{children:t.jsx(IN,{router:fO})}),t.jsx(O2,{fallback:null,children:t.jsx(CR,{})})]})}):t.jsx(oy,{children:t.jsx("div",{className:"center",style:{height:"100%"},children:t.jsxs("div",{style:{maxWidth:460},children:[t.jsx("h2",{children:"Open squad-kit once from a terminal"}),t.jsx("p",{children:"This browser has not opened squad-kit yet, so it does not have its private link. Run this in a terminal: it opens the board here, and after that new tabs and bookmarks work too."}),t.jsx(re,{text:"squad"})]})})})}));